Skip to content

Commit

Permalink
Merge pull request #23 from mulkieran/cargo-lints
Browse files Browse the repository at this point in the history
Use Cargo.toml to specify lint policy
  • Loading branch information
mulkieran authored Jul 29, 2024
2 parents 2b16ff3 + 93869e0 commit f27963f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,15 @@ once_cell = "1.19.0"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.68"
tempfile = "3.4.0"

[lints.rust]
warnings = { level = "deny" }
future_incompatible = { level = "deny", priority = 1 }
unused = { level = "deny", priority = 2}
rust_2018_idioms = { level = "deny", priority = 3 }
nonstandard_style = { level = "deny", priority = 4 }

[lints.clippy]
all = { level = "deny" }
cargo = { level = "deny" , priority = 1}
multiple-crate-versions = { level = "allow", priority = 2 }
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@ else
CLIPPY_OPTS = --fix
endif

DENY = -D warnings -D future-incompatible -D unused -D rust_2018_idioms -D nonstandard_style

CLIPPY_DENY = -D clippy::all -D clippy::cargo -A clippy::multiple-crate-versions

clippy:
RUSTFLAGS="${DENY}" cargo clippy ${CLIPPY_OPTS} -- ${CLIPPY_DENY}
cargo clippy ${CLIPPY_OPTS}

SET_LOWER_BOUNDS ?=
test-set-lower-bounds:
echo "Testing that SET_LOWER_BOUNDS environment variable is set to a valid path"
test -e "${SET_LOWER_BOUNDS}"

verify-dependency-bounds: test-set-lower-bounds
RUSTFLAGS="${DENY}" cargo build ${MANIFEST_PATH_ARGS}
cargo build ${MANIFEST_PATH_ARGS}
${SET_LOWER_BOUNDS} ${MANIFEST_PATH_ARGS}
RUSTFLAGS="${DENY}" cargo build ${MANIFEST_PATH_ARGS}
cargo build ${MANIFEST_PATH_ARGS}

COMPARE_FEDORA_VERSIONS ?=
test-compare-fedora-versions:
Expand Down

0 comments on commit f27963f

Please sign in to comment.