Skip to content

Commit 1d4cbb5

Browse files
committed
fix: Only flag TODO comments in script code, not in strings/docstrings
Updated TODO detection to only flag actual TODO comments in the script code: - Match pattern: '# TODO:' at start of line (actual work needed) - Ignore: TODOs in docstrings, strings, or variable names - Allows scripts like review_pr.py to check for TODOs in other code Example false positive fixed: - '"""Check for TODO/FIXME comments."""' - Not flagged - 'pattern = re.compile(r"TODO")' - Not flagged - '# TODO: implement this feature' - Still flagged (correct)
1 parent e07ca9b commit 1d4cbb5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/validate-resources.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ jobs:
155155
found=0
156156
157157
while IFS= read -r script; do
158-
if grep -qi '\bTODO\b' "$script"; then
159-
echo "⚠️ $script: Contains TODO comments"
158+
# Only flag TODO comments indicating work needed on this script
159+
# Ignore TODOs in strings/docstrings about checking other code
160+
if grep -qiE '^[[:space:]]*#[[:space:]]*TODO:' "$script"; then
161+
echo "⚠️ $script: Contains TODO comments indicating incomplete work"
160162
((found++))
161163
fi
162164
# Only flag "stub" in comments indicating incomplete work

0 commit comments

Comments
 (0)