File tree 6 files changed +91
-0
lines changed
6 files changed +91
-0
lines changed Original file line number Diff line number Diff line change @@ -142,3 +142,25 @@ members = [
142
142
" ctest-test" ,
143
143
" libc-test" ,
144
144
]
145
+
146
+ #
147
+ # TODO: These should be renamed as `[workspace.lints.*]` once MSRV is abve 1.64
148
+ # This way all crates can use it with `[lints] workspace=true` section
149
+ #
150
+
151
+ [lints .rust ]
152
+ # TODO: make ident usage consistent in each file
153
+ unused_qualifications = " allow"
154
+
155
+ [lints .clippy ]
156
+ # TODO: all these are default lints and should probably be fixed
157
+ identity_op = " allow"
158
+ if_same_then_else = " allow"
159
+ missing_safety_doc = " allow"
160
+ non_minimal_cfg = " allow"
161
+ precedence = " allow"
162
+ redundant_field_names = " allow"
163
+ redundant_static_lifetimes = " allow"
164
+ unnecessary_cast = " allow"
165
+ unused_unit = " allow"
166
+ zero_ptr = " allow"
Original file line number Diff line number Diff line change 4
4
5
5
[ -n " ${CI:- } " ] && check=" --check"
6
6
7
+ # TODO: for some reason using `--workspace` validates a lot of generated code in ./target/** dir
8
+ cargo clippy -p
[email protected] -p ctest --all-targets -- -D warnings
9
+
7
10
cargo test --manifest-path libc-test/Cargo.toml --test style -- --nocapture
8
11
9
12
command -v rustfmt
Original file line number Diff line number Diff line change @@ -44,9 +44,13 @@ test_target() {
44
44
# The basic command that is run each time
45
45
cmd=" cargo +$rust build --target $target "
46
46
47
+ # The basic clippy command
48
+ clippy_cmd=" cargo +$rust clippy --all-targets --target $target "
49
+
47
50
if [ " ${no_dist} " != " 0" ]; then
48
51
# If we can't download a `core`, we need to build it
49
52
cmd=" $cmd -Zbuild-std=core,alloc"
53
+ clippy_cmd=" $clippy_cmd -Zbuild-std=core,alloc"
50
54
51
55
# FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
52
56
RUSTFLAGS=" ${RUSTFLAGS:- } -Aimproper_ctypes_definitions"
@@ -67,6 +71,9 @@ test_target() {
67
71
done
68
72
fi
69
73
74
+ # Run cargo clippy first
75
+ $clippy_cmd
76
+
70
77
# Test with expected combinations of features
71
78
$cmd
72
79
$cmd --features extra_traits
Original file line number Diff line number Diff line change @@ -28,3 +28,17 @@ test = false
28
28
[[bin ]]
29
29
name = " t2_cxx"
30
30
test = false
31
+
32
+ #
33
+ # TODO: These should be moved to the root Cargo.toml as `[workspace.lints.*]` once MSRV is abve 1.64
34
+ # replace it with `[lints] workspace=true`
35
+ #
36
+
37
+ [lints .rust ]
38
+ # TODO: make ident usage consistent in each file
39
+ unused_qualifications = " allow"
40
+
41
+ [lints .clippy ]
42
+ # TODO: fix these, and enable pedantic lints with needed exceptions
43
+ match_like_matches_macro = " allow"
44
+ eq_op = " allow"
Original file line number Diff line number Diff line change @@ -13,3 +13,25 @@ garando_syntax = "0.1"
13
13
cc = " 1.0.1"
14
14
rustc_version = " 0.4"
15
15
indoc = " 2.0.6"
16
+
17
+ #
18
+ # TODO: These should be moved to the root Cargo.toml as `[workspace.lints.*]` once MSRV is abve 1.64
19
+ # replace it with `[lints] workspace=true`
20
+ #
21
+
22
+ [lints .rust ]
23
+ # TODO: make ident usage consistent in each file
24
+ unused_qualifications = " allow"
25
+
26
+ [lints .clippy ]
27
+ # TODO: fix these, and enable pedantic lints with needed exceptions
28
+ doc_lazy_continuation = " allow"
29
+ if_same_then_else = " allow"
30
+ needless_borrow = " allow"
31
+ needless_borrowed_reference = " allow"
32
+ needless_borrows_for_generic_args = " allow"
33
+ needless_lifetimes = " allow"
34
+ only_used_in_recursion = " allow"
35
+ option_as_ref_deref = " allow"
36
+ type_complexity = " allow"
37
+ useless_format = " allow"
Original file line number Diff line number Diff line change @@ -102,3 +102,26 @@ harness = true
102
102
name = " style_tests"
103
103
path = " test/style_tests.rs"
104
104
harness = true
105
+
106
+ #
107
+ # TODO: These should be moved to the root Cargo.toml as `[workspace.lints.*]` once MSRV is abve 1.64
108
+ # replace it with `[lints] workspace=true`
109
+ #
110
+
111
+ [lints .rust ]
112
+ # TODO: make ident usage consistent in each file
113
+ unused_qualifications = " allow"
114
+
115
+ [lints .clippy ]
116
+ # TODO: fix these, and enable pedantic lints with needed exceptions
117
+ needless_return = " allow"
118
+ comparison_to_empty = " allow"
119
+ unused_io_amount = " allow"
120
+ write_with_newline = " allow"
121
+ needless_borrows_for_generic_args = " allow"
122
+ only_used_in_recursion = " allow"
123
+ match_like_matches_macro = " allow"
124
+ useless_format = " allow"
125
+ wildcard_in_or_patterns = " allow"
126
+ nonminimal_bool = " allow"
127
+ match_single_binding = " allow"
You can’t perform that action at this time.
0 commit comments