build(cargo): specify clippy flags in Cargo.toml

Avoids needing to pass them as parameters whenever we run cargo clippy.
This commit is contained in:
Paul Campbell 2024-05-02 15:00:59 +01:00
parent 31ef0c19fb
commit d42c8fb890
3 changed files with 16 additions and 2 deletions

View file

@ -73,3 +73,9 @@ anyhow = "1.0"
[package.metadata.bin] [package.metadata.bin]
# Conventional commits githook # Conventional commits githook
cc-cli = { version = "0.1" } cc-cli = { version = "0.1" }
[lints.clippy]
nursery = "warn"
# pedantic = "warn"
unwrap_used = "warn"
expect_used = "warn"

View file

@ -24,7 +24,15 @@ command = ["cargo", "check", "--all-targets", "--color", "always"]
need_stdout = false need_stdout = false
[jobs.clippy] [jobs.clippy]
command = ["cargo", "clippy", "--all-targets", "--color", "always", "--", "-Dwarnings", "-Wclippy::nursery", "-Wclippy::unwrap_used", "-Wclippy::expect_used"] command = [
"cargo",
"clippy",
"--all-targets",
"--color",
"always",
"--",
"-Dwarnings",
]
# "-Wclippy::pedantic", # "-Wclippy::pedantic",
need_stdout = false need_stdout = false

View file

@ -5,7 +5,7 @@ install-hooks:
validate-dev-branch: validate-dev-branch:
git rebase -i origin/main -x 'cargo build' git rebase -i origin/main -x 'cargo build'
git rebase -i origin/main -x 'cargo test' git rebase -i origin/main -x 'cargo test'
git rebase -i origin/main -x 'cargo clippy -- -D warnings -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used' git rebase -i origin/main -x 'cargo clippy -- -D warnings'
start-ngrok: start-ngrok:
#!/usr/bin/env bash #!/usr/bin/env bash