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.
57 lines
2.1 KiB
YAML
57 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ["**"]
|
|
# Lets `hive-forge ci-rerun` re-trigger CI via the workflow-dispatch API
|
|
# without an empty commit. No effect on the PR-triggered runs above.
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check:
|
|
name: nix flake check
|
|
runs-on: [hive-ci]
|
|
# Bound the job so a wedged build fails in minutes instead of
|
|
# hanging until the runner's 3h cap (or, when the runner itself
|
|
# deadlocks, never). 30 min is well above a cold-cache rebuild
|
|
# (~15 min observed) and well under the 3h hard cap — tune if a
|
|
# legit cold build ever trips it.
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: check
|
|
# Runs all flake checks: formatting (treefmt+rustfmt), cargo test,
|
|
# cargo clippy, and module evaluation. No --no-build: the checks
|
|
# derivations are the canonical source of truth.
|
|
run: nix flake check
|
|
|
|
tracker-tags:
|
|
name: tracker-tag lint
|
|
runs-on: [hive-ci]
|
|
# Pure git+grep — seconds normally; a few minutes is already a hang.
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: lint
|
|
# Flags hash-number tracker tags in source (hive convention is
|
|
# prose, not tags — /knowledge/hive-rules.md). Runs as its own
|
|
# job, kept out of the required checks while the legacy backlog
|
|
# is cleaned up: a hit fails this check (red) without blocking
|
|
# 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
|