Skip to content

Comments

Modernize CI workflows and enforce strict linting#129

Draft
e-desouza wants to merge 1 commit intofix/clippy-and-formattingfrom
chore/ci-hardening
Draft

Modernize CI workflows and enforce strict linting#129
e-desouza wants to merge 1 commit intofix/clippy-and-formattingfrom
chore/ci-hardening

Conversation

@e-desouza
Copy link
Collaborator

High Level Overview of Change

  • Replace deprecated actions-rs/* with dtolnay/rust-toolchain and direct cargo commands (actions-rs has been archived)
  • Upgrade actions/checkout from v1/v2 to v4
  • Add cargo fmt --check step to quality workflow
  • Enforce -D warnings on clippy in CI and pre-commit hook
  • Add rustfmt.toml with import ordering rules
  • Change pre-commit hook to check formatting rather than auto-fix
  • Fix duplicate "Build only core" step name (was building json-rpc)

Context of Change

The CI workflows were relying on actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1, and actions-rs/audit-check@v1, all of which have been archived and are no longer maintained. GitHub has been printing deprecation warnings on every run.

The replacement approach uses dtolnay/rust-toolchain@stable (actively maintained, widely adopted) and runs cargo commands directly, which is the recommended pattern going forward.

The pre-commit hook was running cargo fmt (silently auto-fixing) and cargo clippy --fix --allow-staged (also silently fixing). This hides issues from developers. Changed to --check mode so problems are surfaced rather than papered over.

Depends on #128 (fix/clippy-and-formatting) since the codebase needs to be clean before strict enforcement is turned on.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Before / After

Before:

  • CI uses archived actions-rs/* actions with deprecation warnings
  • actions/checkout@v1 and @v2
  • No cargo fmt check in CI
  • Clippy runs without -D warnings (warnings are informational only)
  • Pre-commit hook silently auto-fixes formatting and clippy issues

After:

  • CI uses dtolnay/rust-toolchain@stable and direct cargo invocations
  • actions/checkout@v4
  • cargo fmt -- --check runs in the quality workflow
  • cargo clippy --all-features -- -D warnings enforced in CI
  • Pre-commit hook fails on violations instead of silently fixing them
  • rustfmt.toml ensures consistent import grouping and ordering

Test Plan

Verified locally that all CI-equivalent commands pass:

cargo fmt -- --check
cargo clippy --all-features -- -D warnings
cargo test --all-features
cargo audit

The workflow YAML was validated for correct syntax. Actual CI execution will be verified when this PR triggers the workflows.

@e-desouza e-desouza marked this pull request as draft February 21, 2026 00:11
@e-desouza e-desouza changed the base branch from main to fix/clippy-and-formatting February 21, 2026 00:20
- Replace deprecated actions-rs/* with dtolnay/rust-toolchain and
  direct cargo commands (actions-rs has been archived)
- Upgrade actions/checkout from v1/v2 to v4
- Add cargo fmt --check step to quality workflow
- Enforce -D warnings on clippy in CI and pre-commit hook
- Add rustfmt.toml with import ordering rules
- Change pre-commit hook to check formatting rather than auto-fix
- Fix duplicate "Build only core" step name (was building json-rpc)
@e-desouza e-desouza force-pushed the fix/clippy-and-formatting branch from de398b0 to aa53d7f Compare February 21, 2026 05:19
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