Skip to content

ci(lint): consolidate lint into pre-commit, front-load locally - #8

Closed
adust09 wants to merge 4 commits into
mainfrom
ci/lint-to-pre-commit
Closed

ci(lint): consolidate lint into pre-commit, front-load locally#8
adust09 wants to merge 4 commits into
mainfrom
ci/lint-to-pre-commit

Conversation

@adust09

@adust09 adust09 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Stacked on #5 (base ci/static-analysis-scaffold). Retarget to main after #5 merges, or merge after it.

Why

CI lint is scattered across three workflow definitions, so lint failures only surface after push — forcing a push → fail → fix → re-push round-trip. NyxFoundation/verity is public, so GitHub Actions is free; the burden to cut is (1) those CI round-trips and (2) maintaining lint rules in three places.

What

Consolidate lint into a single .pre-commit-config.yaml, run as local git hooks (fast feedback before push) and as one Quality / pre-commit job (enforcement gate that still catches --no-verify bypasses and contributors who never ran pre-commit install).

  • .pre-commit-config.yaml (new) — hygiene hooks + typos + markdownlint-cli2 (commit stage), reusing the existing _typos.toml / .markdownlint.jsonc; local cargo fmt (commit) and clippy (pre-push) honour rust-toolchain.toml. No lint settings are duplicated.
  • quality.yml — replace the typos job with a pre-commit job (SKIP=fmt,clippy: the lightweight job has no toolchain; rust.yml runs those where the cache lives).
  • docs.yml — drop the markdownlint step; rename lintlinks (offline link check only).
  • dependabot.yml — track the pre-commit ecosystem so hook revs auto-update.
  • CONTRIBUTING.md (new) + README pointer — setup and a what-runs-where table.

rust.yml is unchanged: cargo fmt --check / clippy / test / build / deny stay where the toolchain and build cache live.

Config / execution split

The same config runs in both places by design: local = fast feedback, CI = enforcement. Only the execution runs twice (local is free; the CI lint run is a few seconds on a public runner) — the lint rules live in one file, so they never drift.

Verification

  • pre-commit run --all-files → all hooks pass on the current tree (hygiene, typos, markdownlint, cargo fmt).
  • pre-commit run --all-files --hook-stage pre-pushcargo clippy passes.
  • SKIP=fmt,clippy pre-commit run --all-files → mirrors the CI job; cargo fmt correctly skipped, rest pass.
  • All workflow YAML and dependabot.yml parse; no dangling job references (deploy needs build).

adust09 and others added 4 commits May 27, 2026 11:34
Establish CI and static-test gates now, so the first implementation PR passes
through a complete set of checks rather than retrofitting them later.

- Rust quality gate (rust.yml): cargo fmt / clippy -D warnings / test / build
  over a minimal verity-types canary crate; toolchain pinned to 1.94.0,
  Swatinem/rust-cache for speed.
- Supply-chain: cargo-deny (deny.toml) + Dependabot (github-actions + cargo).
- Docs quality: markdownlint + offline lychee link check added to docs.yml.
- Quality workflow: repo-wide typos spell-check + weekly online link check.
- Secret scanning: betterleaks pinned image (secret-scan.yml).
- .gitignore for Rust/Lean build artifacts.

Lean proof CI is intentionally out of scope: the Verified Core (Verity
Consensus) lives in a separate repository.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- secret-scan: inject `safe.directory=/repo` via GIT_CONFIG_* env so betterleaks'
  in-container git accepts the bind-mounted, differently-owned working tree
  (was failing with "detected dubious ownership").
- lychee.toml: drop unsupported `exclude_mail` (mail is excluded by default in
  lychee 0.23) — it broke config parsing and failed the docs link check.
- secret-scan + quality: restrict the `push` trigger to main so feature-branch
  pushes don't double-run alongside the pull_request trigger.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop Dependabot version updates entirely (github-actions + cargo ecosystems).
Dependency and action update PRs will no longer be auto-opened.
Move the scattered lint definitions (typos job in quality.yml, markdownlint
step in docs.yml) into a single .pre-commit-config.yaml that runs both as
local git hooks (fast feedback before push) and as a consolidated
`Quality / pre-commit` job (enforcement gate for --no-verify bypasses and
contributors without hooks installed).

- Add .pre-commit-config.yaml: hygiene hooks + typos + markdownlint (commit
  stage) reusing the existing _typos.toml / .markdownlint.jsonc, plus local
  cargo fmt (commit) and clippy (pre-push) honouring rust-toolchain.toml.
- quality.yml: replace the typos job with a pre-commit job
  (SKIP=fmt,clippy — the lightweight job has no toolchain; rust.yml runs those).
- docs.yml: drop the markdownlint step; rename lint -> links (offline link
  check only).
- Add CONTRIBUTING.md (setup + what-runs-where) and link it from README.

rust.yml is unchanged: cargo fmt --check / clippy / test / build / deny stay
where the toolchain and build cache live.
@adust09
adust09 force-pushed the ci/lint-to-pre-commit branch from 506644b to 7a67959 Compare June 23, 2026 09:03
Base automatically changed from ci/static-analysis-scaffold to main July 23, 2026 06:55
@adust09

adust09 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #16: the branch carried the pre-squash commits of #5 and became conflicting after #5 was squash-merged. #16 is the same change rebased onto main (single commit).

@adust09 adust09 closed this Jul 23, 2026
@adust09
adust09 deleted the ci/lint-to-pre-commit branch July 23, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant