feat(#2081): CI lint for comment blocks over 30 lines
Flags any contiguous comment block longer than 30 lines — the threshold above which a why/impl-notes block should move to docs/ rather than live in-code (the #2077 rubric, made self-enforcing). - scripts/check-comment-blocks.sh: git+awk, mirrors check-issue-refs.sh's capture-output shape (robust to xargs batching). Handles # line comments (nix/sh), // line comments (rs/js/ts), and /* */ (rs/js/ts/css) + <!-- --> (html) block comments. Blank separates line-comment blocks; a blank inside a /* */ / <!-- --> block stays part of it. lint:allow-long-comment escape hatch. Threshold is a tunable constant. - ci.yml: own 'comment-block lint' job, kept OUT of required checks while the tree settles (red signal, not a merge gate), like the tracker-tag lint. Current tree has 6 blocks > 30 (all in the frontend + hive-c0re-core #2077 slices, none in nix/infra): matrix-accounts.js, permissions.js, stream-worker.js, terminal.js, hivectl.rs:1036, assets.rs. Non-required, so non-blocking — they're the remaining #2077 targets for those area owners.
This commit is contained in:
parent
962f417509
commit
bd86a3c1dd
2 changed files with 91 additions and 0 deletions
|
|
@ -40,3 +40,18 @@ jobs:
|
|||
# merge. Promote to a required check once the tree is clean.
|
||||
# See scripts/check-issue-refs.sh.
|
||||
run: sh scripts/check-issue-refs.sh
|
||||
|
||||
comment-blocks:
|
||||
name: comment-block lint
|
||||
runs-on: [hive-ci]
|
||||
# Pure git+awk — seconds.
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: lint
|
||||
# Flags contiguous comment blocks over 30 lines (a giant prose
|
||||
# block belongs in docs/ as implementation notes, not in source).
|
||||
# Own job, kept out of required checks while the tree settles: a
|
||||
# hit reds this check without blocking merge. Promote to required
|
||||
# once clean. See scripts/check-comment-blocks.sh.
|
||||
run: sh scripts/check-comment-blocks.sh
|
||||
|
|
|
|||
Loading…
Reference in a new issue