fix(ci): portability-lint: anchor is_comment to block-level HTML comments#1338
Conversation
…ents pending_annot carry-forward treated any line containing `<!--` as a comment, including content lines that merely happen to carry an inline HTML comment marker. Because a non-annotated "comment" line left pending_annot unchanged instead of resetting it, a content line with an inline `<!--` could silently extend a prior annotation's coverage to a later, unannotated line. Anchor is_comment's HTML-comment branch to `^[[:space:]]*<!--` so only a genuine dedicated comment line can set or carry pending_annot, per the reviewer's suggested fix on #611. Closes #611 🤖 Generated with Claude Code Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 1m 25s —— View job PR Review
SummaryCorrect, minimal fix. The one-character anchor (`` — would suppress the The new regex This matches the PR description exactly. Code comment — the inline awk comment explaining the rationale and citing
|
|
Claude finished @kyle-sexton's task in 1m 3s —— View job Security Review
No security issues found. This PR makes a single, tightly scoped fix to Surfaces examined and cleared:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8ff28d4d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
scan_file's awk block (scripts/check-skill-portability.sh) treated any linecontaining an HTML comment-open marker (
<!followed by--) as a commentline for
pending_annotcarry-forward purposes — including a CONTENT linethat merely happens to carry an inline comment marker mid-line (e.g.
diff against origin/main <!-- some other note -->) and is not itselfannotated with
portability-ok:.pending_annotunchanged insteadof resetting it to 0, such a content line could silently extend a prior
genuine annotation's coverage past itself to a later, unannotated line — a
false-negative risk in the fail-closed gate.
is_comment()to require the markerat the start of the line (modulo leading whitespace) — block-level only —
per the reviewer's suggested fix recorded on source-control(ci):portability-lint: pending_annot carry-forward doesn't distinguish inline vs block HTML comments #611, so only a genuine
dedicated comment line can set or carry
pending_annot.Test plan
scripts/check-skill-portability.test.shreproducing the reported scenario: an annotated comment line, followed by a
content line with a hardcoded token and an unrelated inline comment marker
mid-line (
diff against origin/main here <!-- unrelated inline note, not an annotation -->), followed by a third unannotated content line with the samehardcoded token. Confirmed the new case fails against the pre-fix script
(line 3 wrongly excused) and passes after the fix (line 3 correctly flagged,
line 2 still excused via
annotated_above).PASS=17 FAIL=0(wasPASS=16before this change; the16 pre-existing cases still pass unchanged).
shellcheck(repo.shellcheckrc) andshfmt -dclean on both modifiedfiles.
Closes #611
Related
deferred this finding out of that PR's scope to keep its diff scoped to the
gate's initial ship).
the
^[[:space:]]*<!--anchor doesn't recognize a block comment nestedinside a Markdown list/blockquote container (e.g.
- <!-- portability-ok: ... -->). Verified not a live regression (noportability-ok:usageexists in the corpus today); deferred as new scope beyond source-control(ci):portability-lint: pending_annot carry-forward doesn't distinguish inline vs block HTML comments #611's literal
acceptance criteria.
(same file/area, also deferred,
needs-human).🤖 Generated with Claude Code