Skip to content

Commit 491549a

Browse files
nyurikpvdrz
authored andcommitted
Consolidate clippy configuration
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.
1 parent 061cc5e commit 491549a

File tree

7 files changed

+29
-0
lines changed

7 files changed

+29
-0
lines changed

Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ similar = "2.2.1"
4747
syn = "2.0"
4848
tempfile = "3"
4949

50+
[workspace.lints.rust]
51+
# unused_qualifications = "warn"
52+
53+
[workspace.lints.clippy]
54+
# disallowed-names = "allow"
55+
# manual-c-str-literals = "allow"
56+
# missing-safety-doc = "allow"
57+
# op-ref = "allow"
58+
# ptr-offset-with-cast = "allow"
59+
# too-many-arguments = "allow"
60+
# transmute-int-to-bool = "allow"
61+
# unnecessary-cast = "allow"
62+
# useless-transmute = "allow"
63+
5064
# Config for 'cargo dist'
5165
[workspace.metadata.dist]
5266
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)

bindgen-cli/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
lints.workspace = true
2+
13
[package]
24
authors = [
35
"The rust-bindgen project contributors",

bindgen-integration/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
lints.workspace = true
2+
13
[package]
24
name = "bindgen-integration"
35
description = "A package to test various bindgen features"

bindgen-tests/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
lints.workspace = true
2+
13
[package]
24
name = "bindgen-tests"
35
version = "0.1.0"

bindgen-tests/tests/expectations/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ block.workspace = true
1616
libloading.workspace = true
1717
objc.workspace = true
1818

19+
# Both of these sections need to be copied here from the workspace because
20+
# Cargo currently does not allow overriding workspace settings in a member
1921
[lints.rust]
2022
### FIXME: these might need to be fixed,
2123
### esp the calling convention, because it is a hard error now
2224
# deprecated = "allow"
2325
# invalid-value = "allow"
2426
# unsupported_calling_conventions = "allow"
27+
#
28+
# Different from the workspace
2529
dead_code = "allow"
2630
non-snake-case = "allow"
2731
non_camel_case_types = "allow"
2832
non_upper_case_globals = "allow"
2933
unexpected-cfgs = "allow"
34+
unused_qualifications = "allow"
3035

3136
[lints.clippy]
3237
disallowed-names = "allow"

bindgen-tests/tests/quickchecking/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
lints.workspace = true
2+
13
[package]
24
name = "quickchecking"
35
description = "Bindgen property tests with quickcheck. Generate random valid C code and pass it to the csmith/predicate.py script"

bindgen/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
lints.workspace = true
2+
13
[package]
24
authors = [
35
"Jyun-Yan You <[email protected]>",

0 commit comments

Comments
 (0)