Skip to content

Commit

Permalink
Consolidate clippy configuration
Browse files Browse the repository at this point in the history
Move all clippy configurations to one central place, except for the expected tests - they seem to require their own handling for now due to a Cargo limitation.

Also, fixed a lot of `unused_qualifications` lints.
  • Loading branch information
nyurik authored and pvdrz committed Dec 1, 2024
1 parent 061cc5e commit 491549a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ similar = "2.2.1"
syn = "2.0"
tempfile = "3"

[workspace.lints.rust]
# unused_qualifications = "warn"

[workspace.lints.clippy]
# disallowed-names = "allow"
# manual-c-str-literals = "allow"
# missing-safety-doc = "allow"
# op-ref = "allow"
# ptr-offset-with-cast = "allow"
# too-many-arguments = "allow"
# transmute-int-to-bool = "allow"
# unnecessary-cast = "allow"
# useless-transmute = "allow"

# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
Expand Down
2 changes: 2 additions & 0 deletions bindgen-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
authors = [
"The rust-bindgen project contributors",
Expand Down
2 changes: 2 additions & 0 deletions bindgen-integration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
name = "bindgen-integration"
description = "A package to test various bindgen features"
Expand Down
2 changes: 2 additions & 0 deletions bindgen-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
name = "bindgen-tests"
version = "0.1.0"
Expand Down
5 changes: 5 additions & 0 deletions bindgen-tests/tests/expectations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ block.workspace = true
libloading.workspace = true
objc.workspace = true

# Both of these sections need to be copied here from the workspace because
# Cargo currently does not allow overriding workspace settings in a member
[lints.rust]
### FIXME: these might need to be fixed,
### esp the calling convention, because it is a hard error now
# deprecated = "allow"
# invalid-value = "allow"
# unsupported_calling_conventions = "allow"
#
# Different from the workspace
dead_code = "allow"
non-snake-case = "allow"
non_camel_case_types = "allow"
non_upper_case_globals = "allow"
unexpected-cfgs = "allow"
unused_qualifications = "allow"

[lints.clippy]
disallowed-names = "allow"
Expand Down
2 changes: 2 additions & 0 deletions bindgen-tests/tests/quickchecking/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
name = "quickchecking"
description = "Bindgen property tests with quickcheck. Generate random valid C code and pass it to the csmith/predicate.py script"
Expand Down
2 changes: 2 additions & 0 deletions bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
authors = [
"Jyun-Yan You <jyyou.tw@gmail.com>",
Expand Down

0 comments on commit 491549a

Please sign in to comment.