Commit b784d71
committed
fix: Only check for TODO/mock in comments, not strings
The previous check flagged TODO/mock anywhere in Python scripts,
including legitimate uses in:
- String literals (error messages, docstrings)
- Code that checks for TODOs (like code review scripts)
Updated all three checks to only flag patterns in actual comment
lines (starting with #):
- TODO detection: ^\s*#.*\bTODO\b
- Stub detection: ^\s*#.*(stub patterns)
- Mock detection: ^\s*#.*\bmock\b.*\bimplementation\b
This eliminates false positives while preserving detection of
incomplete work marked in comments.1 parent 7bb21ea commit b784d71
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | | - | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
0 commit comments