Skip to content

Commit 78124f3

Browse files
sbryngelsonclaude
andcommitted
Fix check_hardcoded_byte_size false-positive on inline comments
byte_re was run against the full stripped line, so a comment like ! old code: int(8._wp, kind=i64) would be flagged even though the pattern is inside a Fortran ! comment. Strip the inline comment portion before searching. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9dc43a7 commit 78124f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

toolchain/mfc/lint_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def check_hardcoded_byte_size(repo_root: Path) -> list[str]:
142142
stripped = line.strip()
143143
if _is_comment_or_blank(stripped):
144144
continue
145-
if byte_re.search(stripped):
145+
if byte_re.search(stripped.split("!")[0]):
146146
errors.append(
147147
f" {rel}:{i + 1} hard-codes 8-byte real size."
148148
" Fix: use 'storage_size(0._wp)/8' instead of"

0 commit comments

Comments
 (0)