Relationships
#3153 extension push: a swamp-quality-ignore directive after a comment holding an apostrophe is silently ignored
Opened by skunk-ape · 10/7/2026
Problem
findDirectiveStart in src/domain/extensions/extension_acceptances.ts checks whether the directive's // opener is inside quotes by scanning the whole line prefix for quote characters. An apostrophe in an earlier line comment counts as an open string, so a directive after it is not recognised:
new Deno.Command(cmd); // don't inline // swamp-quality-ignore deno-commandparses zero directives: the finding stays unaccepted and nothing says why (no invalid-acceptance, no stale-acceptance).
Notes
Found while working on swamp-club#3107. A fix that treats an opener after an unquoted // as inside a comment was tried and reverted there: quote-only tracking reads a regex literal holding two slashes as a line comment (const re = /a//; const s = "it's // swamp-quality-ignore x"), which would turn string text into a directive. A fix needs real tokenisation (the Babel parser is already used by dynamic_code_detector.ts and commentSites), or at least an invalid-acceptance warning when the keyword follows a comment opener but is not recognised.
Since #3107 the report suggests every source acceptance on its own line above, so this only affects hand-written trailing directives.
Open
No activity in this phase yet.
Sign in to post a ripple.