Rust-based hooks for pre-commit and pre-commit.ci.
Runs cargo fmt with RUSTUP_TOOLCHAIN=nightly.
Example:
- repo: https://github.com/arista-netdevops-community/pre-commit-hooks
rev: <rev>
hooks:
- id: cargo-fmt-nightly
args:
- --all
- --
- --config
- unstable_features=true,group_imports=StdExternalCrate,imports_granularity=ItemRuns cargo fmt with the target repository's selected Rust toolchain.
Example:
- repo: https://github.com/arista-netdevops-community/pre-commit-hooks
rev: <rev>
hooks:
- id: cargo-fmt
args: ["--all"]Runs cargo check with the target repository's selected Rust toolchain.
Example:
- repo: https://github.com/arista-netdevops-community/pre-commit-hooks
rev: <rev>
hooks:
- id: cargo-check
args: ["--locked"]Runs cargo clippy with the target repository's selected Rust toolchain.
Example:
- repo: https://github.com/arista-netdevops-community/pre-commit-hooks
rev: <rev>
hooks:
- id: cargo-clippy
args: ["--locked", "--all-targets", "--all-features"]Runs cargo deny. The hook installs cargo-deny as a Cargo CLI dependency.
Example:
- repo: https://github.com/arista-netdevops-community/pre-commit-hooks
rev: <rev>
hooks:
- id: cargo-deny
args: ["--locked", "--all-features", "check"]Runs cargo about. The hook installs cargo-about as a Cargo CLI dependency.
Example:
- repo: https://github.com/arista-netdevops-community/pre-commit-hooks
rev: <rev>
hooks:
- id: cargo-about
name: Generate third-party Rust licenses
args:
- generate
- --locked
- --fail
- -o
- pyavd_utils/THIRD_PARTY_LICENSES.txt
- about-text.hbs