Skip to content

Commit

Permalink
Add precommit config
Browse files Browse the repository at this point in the history
Signed-off-by: lloydmeta <[email protected]>
  • Loading branch information
lloydmeta committed Nov 17, 2023
1 parent 1791931 commit 36907b0
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ci:
autoupdate_schedule: quarterly
skip: [cargo-check, cargo-clippy]
repos:
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt
language: rust
types: [rust]
args: ["--all", "--"]
- id: cargo-check
name: cargo check
entry: cargo check
language: rust
types: [rust]
args: ["--workspace"]
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy
language: rust
types: [rust]
# https://doc.rust-lang.org/stable/clippy/
args: [
"--workspace",
"--",
"-Dwarnings",
"-Dclippy::pedantic",
"-Dclippy::nursery",
"-Dclippy::cargo",
# "Expect many false positives" https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
"-Aclippy::must_use_candidate",
# "It’s not bad at all." https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
"-Aclippy::cast-precision-loss",
# https://github.com/seanmonstar/pretty-env-logger/pull/49
# https://github.com/eminence/terminal-size/pull/49
"-Aclippy::multiple-crate-versions",
]
pass_filenames: false

0 comments on commit 36907b0

Please sign in to comment.