Skip to content

Commit 69e4822

Browse files
committed
Address PR review-toolkit findings
stub-patterns.md: - Split return-nothing grep by language (nil→Go, null/undefined→TS/JS, None→Python) - Fix pass$ regex to use word-boundary pattern (was matching bypass, overpass) - Add test_ prefix to Python test file exclusion self-audit.md: - Align inline TODO grep with stub-patterns.md canonical list (add tsx/jsx/rb/PLACEHOLDER) - Defer hardcoded secrets check to stub-patterns.md (was inconsistent: missing tsx, no test exclusion)
1 parent e53410f commit 69e4822

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

commands/references/stub-patterns.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ grep -rn 'TODO\|FIXME\|HACK\|XXX\|PLACEHOLDER' \
1616

1717
```bash
1818
# Functions that return nothing useful — high false-positive rate.
19-
# Filter results manually: return nil/null/{}/[] is often legitimate.
19+
# Filter results manually: these returns are often legitimate.
2020
# Strongest signal when combined with TODO/FIXME nearby.
21-
grep -rn 'return nil\|return null\|return undefined' \
22-
--include='*.go' --include='*.ts' --include='*.js' --include='*.py' . 2>/dev/null
21+
grep -rn 'return nil' --include='*.go' . 2>/dev/null
22+
grep -rn 'return null\|return undefined' --include='*.ts' --include='*.js' . 2>/dev/null
23+
grep -rn 'return None' --include='*.py' . 2>/dev/null
2324

24-
# Python pass-only functions
25-
grep -rn 'pass$' --include='*.py' . 2>/dev/null
25+
# Python pass-only functions (indented pass on its own line)
26+
grep -rEn '^[[:space:]]+pass[[:space:]]*$' --include='*.py' . 2>/dev/null
2627

2728
# Empty catch/error blocks (use grep -E for extended regex portability)
2829
grep -rEn 'catch[^{]*\{\s*\}' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' . 2>/dev/null
@@ -46,7 +47,7 @@ grep -rn '\[TODO\]\|<TODO>\|{TODO}' \
4647
```bash
4748
# Hardcoded IDs or secrets (not in test files)
4849
grep -rn 'api_key\s*=\s*"[^"]\+"\|password\s*=\s*"[^"]\+"' \
49-
--include='*.go' --include='*.ts' --include='*.tsx' --include='*.py' . 2>/dev/null | grep -v '_test\.\|\.test\.\|\.spec\.'
50+
--include='*.go' --include='*.ts' --include='*.tsx' --include='*.py' . 2>/dev/null | grep -v '_test\.\|\.test\.\|\.spec\.\|test_'
5051

5152
# Hardcoded URLs (not config/const files)
5253
grep -rn 'http://localhost\|127\.0\.0\.1' \

commands/self-audit.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ Record: total coverage %, lowest-coverage packages, untested files.
7575
# Python: pip-audit or safety check
7676
# Rust: cargo audit
7777

78-
# Hardcoded secrets
79-
grep -rn 'password\s*=\s*"[^"]*"' --include='*.go' --include='*.ts' --include='*.py' . 2>/dev/null | head -5
80-
grep -rn 'api_key\s*=\s*"[^"]*"' --include='*.go' --include='*.ts' --include='*.py' . 2>/dev/null | head -5
78+
# Hardcoded secrets — use the patterns from references/stub-patterns.md
79+
# "Hardcoded Values Where Dynamic Expected" section (excludes test files, includes .tsx)
8180
```
8281

8382
### Stale Code
@@ -87,8 +86,10 @@ grep -rn 'api_key\s*=\s*"[^"]*"' --include='*.go' --include='*.ts' --include='*.
8786
# Unused dependencies
8887
# go mod tidy -diff (shows removable deps)
8988
# npm prune --dry-run
90-
# TODO/FIXME/HACK count
91-
grep -rn 'TODO\|FIXME\|HACK\|XXX' --include='*.go' --include='*.ts' --include='*.py' --include='*.rs' . 2>/dev/null | wc -l
89+
# TODO/FIXME/HACK count — matches stub-patterns.md canonical list
90+
grep -rn 'TODO\|FIXME\|HACK\|XXX\|PLACEHOLDER' \
91+
--include='*.go' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' \
92+
--include='*.py' --include='*.rs' --include='*.rb' . 2>/dev/null | wc -l
9293
```
9394

9495
For deeper stub detection (empty implementations, placeholder text, hardcoded values, skipped tests), run the patterns from `references/stub-patterns.md`. Run unconditionally — a repo can have zero TODOs but still contain empty catch blocks, placeholder UI copy, or hardcoded localhost URLs.

0 commit comments

Comments
 (0)