From 08600a1f620306e1952f3e44043b5899da3b3422 Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Thu, 12 Feb 2026 15:45:44 -0500 Subject: [PATCH 1/9] ENG-219: Add TBD check Adds the built-in TBD check that scans configured directories for TBD markers in source files, with configurable skip patterns for directories and file extensions. --- src/commands/check.ts | 11 ++- src/commands/checks/tbd.ts | 137 ++++++++++++++++++++++++++++++ tests/commands/check.test.ts | 26 ++++++ tests/commands/checks/tbd.test.ts | 54 ++++++++++++ 4 files changed, 224 insertions(+), 4 deletions(-) create mode 100644 src/commands/checks/tbd.ts create mode 100644 tests/commands/checks/tbd.test.ts diff --git a/src/commands/check.ts b/src/commands/check.ts index fd6818e..9a8a648 100644 --- a/src/commands/check.ts +++ b/src/commands/check.ts @@ -3,6 +3,7 @@ import chalk from 'chalk'; import { getConfig } from '../config.js'; declare const BUILTIN_CHECK_SLUGS: string[]; +import { executeTbdCheck } from './checks/tbd.js'; import { runCommand } from '../utils/process.js'; import * as output from '../utils/output.js'; import type { CheckConfig, CheckResult } from '../types.js'; @@ -97,19 +98,21 @@ export async function runChecks(options: { * @since TBD * * @param {string} slug - The identifier for the built-in check. - * @param {CheckConfig} _checkConfig - The configuration for this check. - * @param {string} _cwd - The current working directory. + * @param {CheckConfig} checkConfig - The configuration for this check. + * @param {string} cwd - The current working directory. * @param {ReturnType} _config - The resolved pup configuration. * * @returns {Promise} The result of the check. */ async function runBuiltinCheck( slug: string, - _checkConfig: CheckConfig, - _cwd: string, + checkConfig: CheckConfig, + cwd: string, _config: ReturnType ): Promise { switch (slug) { + case 'tbd': + return executeTbdCheck(checkConfig, cwd); default: return { success: false, output: `Unknown built-in check: ${slug}` }; } diff --git a/src/commands/checks/tbd.ts b/src/commands/checks/tbd.ts new file mode 100644 index 0000000..c446fd8 --- /dev/null +++ b/src/commands/checks/tbd.ts @@ -0,0 +1,137 @@ +import chalk from 'chalk'; +import fs from 'fs-extra'; +import path from 'node:path'; +import * as output from '../../utils/output.js'; +import type { CheckConfig, CheckResult } from '../../types.js'; + +const DEFAULT_SKIP_DIRS = 'bin|build|vendor|node_modules|.git|.github|tests'; +const DEFAULT_SKIP_FILES = '.min.css|.min.js|.map.js|.css|.png|.jpg|.jpeg|.svg|.gif|.ico'; +const DEFAULT_DIRS = ['src']; + +interface TbdMatch { + file: string; + line: number; + content: string; +} + +/** + * Scans configured directories for TBD markers. + * + * @since TBD + * + * @param {CheckConfig} config - The check configuration containing directories and skip patterns. + * @param {string} workingDir - The working directory to scan relative to. + * + * @returns {Promise} A CheckResult indicating success or failure with details about found TBDs. + */ +export async function executeTbdCheck( + config: CheckConfig, + workingDir: string +): Promise { + const skipDirs = (config.skip_directories ?? DEFAULT_SKIP_DIRS).split('|'); + const skipFiles = (config.skip_files ?? DEFAULT_SKIP_FILES).split('|'); + const dirs = config.dirs ?? DEFAULT_DIRS; + + output.section('Checking for TBDs...'); + + const matches: TbdMatch[] = []; + + for (const dir of dirs) { + const dirPath = path.resolve(workingDir, dir); + if (!(await fs.pathExists(dirPath))) continue; + await scanDirectory(dirPath, workingDir, skipDirs, skipFiles, matches); + } + + if (matches.length === 0) { + output.success('No TBDs found!'); + output.log(''); + output.log(''); + output.success('Success! No TBDs found.'); + return { success: true, output: '' }; + } + + // Group by file + const grouped = new Map(); + for (const match of matches) { + const existing = grouped.get(match.file) ?? []; + existing.push(match); + grouped.set(match.file, existing); + } + + for (const [file, fileMatches] of grouped) { + const relPath = path.relative(workingDir, file); + output.log(chalk.cyan(relPath)); + for (const m of fileMatches) { + output.log(`${chalk.yellow(`${m.line}:`)} ${m.content.trim()}`); + } + output.log(''); + } + + output.log(''); + output.error('TBDs have been found!'); + + return { success: false, output: '' }; +} + +/** + * Recursively scans a directory for files containing TBD markers. + * + * @since TBD + * + * @param {string} dir - The directory to scan. + * @param {string} workingDir - The working directory used for relative path calculations. + * @param {string[]} skipDirs - Array of directory names to skip during scanning. + * @param {string[]} skipFiles - Array of file extensions/patterns to skip during scanning. + * @param {TbdMatch[]} matches - Array to accumulate TBD matches found during the scan. + * + * @returns {Promise} + */ +async function scanDirectory( + dir: string, + workingDir: string, + skipDirs: string[], + skipFiles: string[], + matches: TbdMatch[] +): Promise { + const entries = await fs.readdir(dir, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + + if (entry.isDirectory()) { + if (skipDirs.some((skip) => entry.name === skip)) continue; + await scanDirectory(fullPath, workingDir, skipDirs, skipFiles, matches); + } else if (entry.isFile()) { + if (skipFiles.some((skip) => entry.name.endsWith(skip))) continue; + if (entry.name.startsWith('.pup-') || entry.name === '.puprc') continue; + await scanFile(fullPath, matches); + } + } +} + +/** + * Scans a single file for lines containing TBD markers. + * + * @since TBD + * + * @param {string} filePath - The full path to the file to scan. + * @param {TbdMatch[]} matches - Array to accumulate TBD matches found in the file. + * + * @returns {Promise} + */ +async function scanFile(filePath: string, matches: TbdMatch[]): Promise { + const contents = await fs.readFile(filePath, 'utf-8'); + const lines = contents.split('\n'); + + const tbdPattern = /\btbd\b/i; + + for (let i = 0; i < lines.length; i++) { + if (tbdPattern.test(lines[i])) { + matches.push({ + file: filePath, + line: i + 1, + content: lines[i], + }); + } + } +} diff --git a/tests/commands/check.test.ts b/tests/commands/check.test.ts index d28e7ac..1a3260c 100644 --- a/tests/commands/check.test.ts +++ b/tests/commands/check.test.ts @@ -38,6 +38,32 @@ describe('check command', () => { }); }); +describe('check subcommands', () => { + afterEach(() => { + cleanupTempProjects(); + }); + + it('should register built-in check:tbd even when not in .puprc', async () => { + const projectDir = createTempProject(); + // Only version-conflict configured, no tbd + writePuprc(getPuprc({ checks: { 'version-conflict': {} } }), projectDir); + + const result = await runPup('check:tbd', { cwd: projectDir }); + expect(result.output).toContain('Checking for TBDs...'); + expect(result.output).not.toContain("unknown command 'check:tbd'"); + }); + + it('should run check:tbd without prefix', async () => { + const projectDir = createTempProject(); + writePuprc(getPuprc(), projectDir); + + const result = await runPup('check:tbd', { cwd: projectDir }); + expect(result.exitCode).toBe(0); + expect(result.output).toContain('Checking for TBDs...'); + expect(result.output).not.toContain('[tbd]'); + }); +}); + describe('custom checks', () => { afterEach(() => { cleanupTempProjects(); diff --git a/tests/commands/checks/tbd.test.ts b/tests/commands/checks/tbd.test.ts new file mode 100644 index 0000000..5b37cd0 --- /dev/null +++ b/tests/commands/checks/tbd.test.ts @@ -0,0 +1,54 @@ +import { + runPup, + writePuprc, + getPuprc, + createTempProject, + cleanupTempProjects, +} from '../../helpers/setup.js'; + +describe('tbd check', () => { + afterEach(() => { + cleanupTempProjects(); + }); + + it('should run successful tbd check', async () => { + const projectDir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), projectDir); + + const result = await runPup('check', { cwd: projectDir }); + expect(result.exitCode).toBe(0); + expect(result.output).toContain('[tbd] Checking for TBDs...'); + expect(result.output).toContain('[tbd] No TBDs found!'); + expect(result.output).toContain('[tbd] Success! No TBDs found.'); + }); + + it('should fail tbd check when tbds exist', async () => { + const tbdDir = createTempProject('fake-project-with-tbds'); + writePuprc(getPuprc({ checks: { tbd: {} } }), tbdDir); + + const result = await runPup('check', { cwd: tbdDir }); + expect(result.exitCode).not.toBe(0); + expect(result.output).toContain('[tbd] Checking for TBDs...'); + expect(result.output).toContain('[tbd] src/Plugin.php'); + expect(result.output).toContain('[tbd] src/Thing/AnotherFile.php'); + expect(result.output).toContain('TBDs have been found!'); + expect(result.output).toContain("tbd's fail_method in .puprc is set to"); + }); + + it('should warn on tbd when fail_method is warn', async () => { + const tbdDir = createTempProject('fake-project-with-tbds'); + const puprc = getPuprc(); + puprc.checks = { + tbd: { + fail_method: 'warn', + }, + }; + writePuprc(puprc, tbdDir); + + const result = await runPup('check', { cwd: tbdDir }); + // Should succeed since tbd is set to warn + expect(result.exitCode).toBe(0); + expect(result.output).toContain('[tbd]'); + expect(result.output).toContain('TBDs have been found!'); + }); +}); From 658fc65a115cc554f72a34a233cdde6b305df809 Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Thu, 12 Feb 2026 15:58:26 -0500 Subject: [PATCH 2/9] ENG-219: Add test for --dev flag using fail_method_dev on tbd check --- tests/commands/checks/tbd.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/commands/checks/tbd.test.ts b/tests/commands/checks/tbd.test.ts index 5b37cd0..9da0bdd 100644 --- a/tests/commands/checks/tbd.test.ts +++ b/tests/commands/checks/tbd.test.ts @@ -35,6 +35,17 @@ describe('tbd check', () => { expect(result.output).toContain("tbd's fail_method in .puprc is set to"); }); + it('should use fail_method_dev when --dev is passed', async () => { + const tbdDir = createTempProject('fake-project-with-tbds'); + writePuprc(getPuprc({ checks: { tbd: {} } }), tbdDir); + + // Default fail_method is 'error', but fail_method_dev is 'warn' + const result = await runPup('check --dev', { cwd: tbdDir }); + expect(result.exitCode).toBe(0); + expect(result.output).toContain('[tbd]'); + expect(result.output).toContain('TBDs have been found!'); + }); + it('should warn on tbd when fail_method is warn', async () => { const tbdDir = createTempProject('fake-project-with-tbds'); const puprc = getPuprc(); From a955db7709ffc291a3f4234841b12938c2031429 Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Thu, 12 Feb 2026 19:13:50 -0500 Subject: [PATCH 3/9] ENG-219: Add test for running only tbd check without version-conflict --- tests/commands/check.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/commands/check.test.ts b/tests/commands/check.test.ts index 54495b9..ae6d8a4 100644 --- a/tests/commands/check.test.ts +++ b/tests/commands/check.test.ts @@ -29,6 +29,15 @@ describe('check command', () => { expect(result.output).toContain('"tbd": {}'); expect(result.output).toContain('"version-conflict": {}'); }); + + it('should run tbd but not version-conflict when only tbd is configured', async () => { + writePuprc(getPuprc({ checks: { tbd: {} } }), projectDir); + + const result = await runPup('check', { cwd: projectDir }); + expect(result.exitCode).toBe(0); + expect(result.output).toContain('[tbd]'); + expect(result.output).not.toContain('[version-conflict]'); + }); }); describe('check subcommands', () => { From 45ccc71ceb4172ede0639aa59a00210c7feba683 Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Thu, 12 Feb 2026 19:15:00 -0500 Subject: [PATCH 4/9] ENG-219: Move tbd-only check test from check.test.ts to tbd.test.ts --- tests/commands/check.test.ts | 9 --------- tests/commands/checks/tbd.test.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/commands/check.test.ts b/tests/commands/check.test.ts index ae6d8a4..54495b9 100644 --- a/tests/commands/check.test.ts +++ b/tests/commands/check.test.ts @@ -29,15 +29,6 @@ describe('check command', () => { expect(result.output).toContain('"tbd": {}'); expect(result.output).toContain('"version-conflict": {}'); }); - - it('should run tbd but not version-conflict when only tbd is configured', async () => { - writePuprc(getPuprc({ checks: { tbd: {} } }), projectDir); - - const result = await runPup('check', { cwd: projectDir }); - expect(result.exitCode).toBe(0); - expect(result.output).toContain('[tbd]'); - expect(result.output).not.toContain('[version-conflict]'); - }); }); describe('check subcommands', () => { diff --git a/tests/commands/checks/tbd.test.ts b/tests/commands/checks/tbd.test.ts index 9da0bdd..908cbdd 100644 --- a/tests/commands/checks/tbd.test.ts +++ b/tests/commands/checks/tbd.test.ts @@ -11,6 +11,16 @@ describe('tbd check', () => { cleanupTempProjects(); }); + it('should run tbd but not version-conflict when only tbd is configured', async () => { + const projectDir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), projectDir); + + const result = await runPup('check', { cwd: projectDir }); + expect(result.exitCode).toBe(0); + expect(result.output).toContain('[tbd]'); + expect(result.output).not.toContain('[version-conflict]'); + }); + it('should run successful tbd check', async () => { const projectDir = createTempProject(); writePuprc(getPuprc({ checks: { tbd: {} } }), projectDir); From a43951dd99e20df9a2dfeba5fd3942e681f09662 Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Sat, 14 Feb 2026 00:12:33 -0500 Subject: [PATCH 5/9] ENG-219: Add --root flag test for TBD check --- tests/commands/checks/tbd.test.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/commands/checks/tbd.test.ts b/tests/commands/checks/tbd.test.ts index 908cbdd..24cc170 100644 --- a/tests/commands/checks/tbd.test.ts +++ b/tests/commands/checks/tbd.test.ts @@ -1,3 +1,5 @@ +import path from 'node:path'; +import fs from 'fs-extra'; import { runPup, writePuprc, @@ -56,6 +58,30 @@ describe('tbd check', () => { expect(result.output).toContain('TBDs have been found!'); }); + it('should only scan files under --root subdirectory', async () => { + const projectDir = createTempProject('fake-project-with-tbds'); + + // Create a subdirectory with its own .puprc and a clean src/ + const subdir = path.join(projectDir, 'subproject'); + fs.mkdirSync(path.join(subdir, 'src'), { recursive: true }); + fs.writeFileSync( + path.join(subdir, 'src', 'Clean.php'), + ' { const tbdDir = createTempProject('fake-project-with-tbds'); const puprc = getPuprc(); From 46c7118cb8ad838b860f54d695f33775766fc85c Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Sat, 14 Feb 2026 00:14:32 -0500 Subject: [PATCH 6/9] ENG-219: Match TBD patterns from PHP implementation exactly --- src/commands/checks/tbd.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/checks/tbd.ts b/src/commands/checks/tbd.ts index f274de5..676232b 100644 --- a/src/commands/checks/tbd.ts +++ b/src/commands/checks/tbd.ts @@ -123,10 +123,14 @@ async function scanFile(filePath: string, matches: TbdMatch[]): Promise { const contents = await fs.readFile(filePath, 'utf-8'); const lines = contents.split('\n'); - const tbdPattern = /\btbd\b/i; + const tbdPatterns = [ + /\*\s*@(since|deprecated|version)\s.*tbd/i, + /_deprecated_\w\(.*['"]tbd['"]/i, + /['"]tbd['"]/i, + ]; for (let i = 0; i < lines.length; i++) { - if (tbdPattern.test(lines[i])) { + if (tbdPatterns.some((pattern) => pattern.test(lines[i]))) { matches.push({ file: filePath, line: i + 1, From 461dfa6aaf3d090fe5160edac1a19741a6cdc921 Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Sat, 14 Feb 2026 00:15:46 -0500 Subject: [PATCH 7/9] ENG-219: Add standalone quoted TBD cases to test fixture --- .../fake-project-with-tbds/src/Thing/AnotherFile.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/fixtures/fake-project-with-tbds/src/Thing/AnotherFile.php b/tests/fixtures/fake-project-with-tbds/src/Thing/AnotherFile.php index 878c29b..27b954c 100644 --- a/tests/fixtures/fake-project-with-tbds/src/Thing/AnotherFile.php +++ b/tests/fixtures/fake-project-with-tbds/src/Thing/AnotherFile.php @@ -32,4 +32,13 @@ public static function do_something_else_entirely() { _deprecated_function( __METHOD__, 'TBD' ); $x = 1; } + + public static function get_version() { + $version = 'TBD'; + return $version; + } + + public static function get_other_version() { + return "TBD"; + } } From 79b7fd30e24810ff21cb7c0a9203a11aaf3e19eb Mon Sep 17 00:00:00 2001 From: Eric Defore Date: Sat, 14 Feb 2026 00:17:33 -0500 Subject: [PATCH 8/9] ENG-219: Add pattern-specific unit tests for TBD check --- tests/commands/checks/tbd-patterns.test.ts | 225 +++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 tests/commands/checks/tbd-patterns.test.ts diff --git a/tests/commands/checks/tbd-patterns.test.ts b/tests/commands/checks/tbd-patterns.test.ts new file mode 100644 index 0000000..e763a83 --- /dev/null +++ b/tests/commands/checks/tbd-patterns.test.ts @@ -0,0 +1,225 @@ +import path from 'node:path'; +import os from 'node:os'; +import fs from 'fs-extra'; +import { executeTbdCheck } from '../../../src/commands/checks/tbd.ts'; +import type { CheckConfig } from '../../../src/types.ts'; + +/** + * Creates a temp directory with a src/ subdirectory containing a single file. + * + * @param {string} filename - The name of the file to create. + * @param {string} content - The content of the file. + * + * @returns {string} The path to the temp directory. + */ +function createTbdFixture(filename: string, content: string): string { + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pup-tbd-pattern-')); + fs.mkdirSync(path.join(tmpDir, 'src'), { recursive: true }); + fs.writeFileSync(path.join(tmpDir, 'src', filename), content); + tempDirs.push(tmpDir); + return tmpDir; +} + +function makeConfig(overrides: Partial = {}): CheckConfig { + return { + slug: 'tbd', + fail_method: 'error', + fail_method_dev: 'warn', + type: 'pup', + args: {}, + ...overrides, + }; +} + +const tempDirs: string[] = []; + +afterEach(() => { + for (const dir of tempDirs) { + if (fs.existsSync(dir)) { + fs.removeSync(dir); + } + } + tempDirs.length = 0; +}); + +describe('tbd pattern matching', () => { + describe('@since/@deprecated/@version docblock tags', () => { + it('should match @since TBD', async () => { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + it('should match _deprecated_function with single-quoted TBD', async () => { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + it('should match single-quoted TBD', async () => { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + it('should not match bare TBD in a comment', async () => { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' { + const dir = createTbdFixture('Test.php', [ + ' Date: Sat, 14 Feb 2026 00:21:45 -0500 Subject: [PATCH 9/9] ENG-219: Move TBD pattern tests into tbd.test.ts --- tests/commands/checks/tbd-patterns.test.ts | 225 -------------------- tests/commands/checks/tbd.test.ts | 230 +++++++++++++++++++++ 2 files changed, 230 insertions(+), 225 deletions(-) delete mode 100644 tests/commands/checks/tbd-patterns.test.ts diff --git a/tests/commands/checks/tbd-patterns.test.ts b/tests/commands/checks/tbd-patterns.test.ts deleted file mode 100644 index e763a83..0000000 --- a/tests/commands/checks/tbd-patterns.test.ts +++ /dev/null @@ -1,225 +0,0 @@ -import path from 'node:path'; -import os from 'node:os'; -import fs from 'fs-extra'; -import { executeTbdCheck } from '../../../src/commands/checks/tbd.ts'; -import type { CheckConfig } from '../../../src/types.ts'; - -/** - * Creates a temp directory with a src/ subdirectory containing a single file. - * - * @param {string} filename - The name of the file to create. - * @param {string} content - The content of the file. - * - * @returns {string} The path to the temp directory. - */ -function createTbdFixture(filename: string, content: string): string { - const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pup-tbd-pattern-')); - fs.mkdirSync(path.join(tmpDir, 'src'), { recursive: true }); - fs.writeFileSync(path.join(tmpDir, 'src', filename), content); - tempDirs.push(tmpDir); - return tmpDir; -} - -function makeConfig(overrides: Partial = {}): CheckConfig { - return { - slug: 'tbd', - fail_method: 'error', - fail_method_dev: 'warn', - type: 'pup', - args: {}, - ...overrides, - }; -} - -const tempDirs: string[] = []; - -afterEach(() => { - for (const dir of tempDirs) { - if (fs.existsSync(dir)) { - fs.removeSync(dir); - } - } - tempDirs.length = 0; -}); - -describe('tbd pattern matching', () => { - describe('@since/@deprecated/@version docblock tags', () => { - it('should match @since TBD', async () => { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - it('should match _deprecated_function with single-quoted TBD', async () => { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - it('should match single-quoted TBD', async () => { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - it('should not match bare TBD in a comment', async () => { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { - const dir = createTbdFixture('Test.php', [ - ' { expect(result.output).toContain('[tbd]'); expect(result.output).toContain('TBDs have been found!'); }); + + describe('pattern matching', () => { + describe('@since/@deprecated/@version docblock tags', () => { + it('should match @since TBD', async () => { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + it('should match _deprecated_function with single-quoted TBD', async () => { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + it('should match single-quoted TBD', async () => { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + it('should not match bare TBD in a comment', async () => { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + ' { + const dir = createTempProject(); + writePuprc(getPuprc({ checks: { tbd: {} } }), dir); + fs.writeFileSync(path.join(dir, 'src', 'Test.php'), [ + '