Repository navigation
refactor: ban code comments; move their decisions to ADRs - #67
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
website | fd52a40 | Nov 21 2026, 11:22 AM |
Self-closing scripts, regex literals and comments in template expressions, frontmatter fences inside strings or after a BOM, and a corrupt baseline no longer let comments through or wipe the baseline.
Hand-rolled brace, quote and fence tracking kept missing comments next to template literals, regexes, JSX text and URLs. The compiler's parse gives the frontmatter, HTML comments, expressions, attributes and script/style bodies directly.
The comment scanner now reads every attribute kind the Astro compiler reports, stops lint when it cannot place parsed text in the source, and catches an unclosed HTML comment. @astrojs/compiler is pinned, since Astro 7's own binding has no parse API.
A raw-source search flagged '<!--' inside strings and threw on an unclosed comment followed by markup.
Empty, abruptly closed, --!> and bogus (<!x>, <?x>) comments no longer throw or lose their closer, and text inside textarea or title is not read as a comment.
…nd tags Comment placement scans forward to the first '<' an opener matches, so a doctype or a '<!' in an attribute no longer stops it. An unclosed comment runs to the end of the file through any expressions after it, and title inside svg or math is not raw text.
…ment Quoted attribute text such as title="<!--" could otherwise be taken for the comment that follows the element.
…exing tags Hand-scanning start tags misread unquoted values with quotes or braces and comments inside expressions, then ran the cursor to the end of the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deletes 1,930 code comments, moves the decisions they recorded into
docs/adr/, and bans new comments with a ratchet.What changed
scripts/generate-{world,brand-marks}.ts), so they stop writing comments back;biome-ignorereasons that used to say "see above".docs/adr/holds 222 ADRs with an index in its README. Every one of the 893 decision records maps to exactly one ADR.excuse.npm run lintnow runsscripts/comments.ts checkfirst.comments-baseline.jsonholds a fingerprint of each comment still allowed: any other comment fails, including an edited one. A deleted comment also fails untilnpm run lint:comments:updatedrops its fingerprint, and that command never adds one..astrothrough@astrojs/compiler's AST (pinned at 2.13.1), plus CSS, YAML, SQL, JSONC and#files.migrations/0002(left alone deliberately: an empty applied migration isn't proven safe on a fresh database);src/lib/lattice/shader.tsandsrc/lib/lattice-wipe.ts;public/_redirects,.gitignore,.dev.vars.example./delete-commentskill in.claude/skills/..gitignorenow tracks.claude/skills/only.recent:v3example (the key isrecent:v4).Checks
Proof:
npm run lint,npm test(475 pass, including the scanner's own tests),npx astro check(0 errors) and a fullnpm run build(csp-union and verify-headers) all pass locally on the rebased head./code-reviewran repeatedly on the scanner until only a nit was left.