File tree 5 files changed +92
-1
lines changed
5 files changed +92
-1
lines changed Original file line number Diff line number Diff line change 29
29
- name : Check style
30
30
run : ./ci/style.sh
31
31
32
+ clippy :
33
+ name : Clippy on ${{ matrix.os }}
34
+ strategy :
35
+ matrix :
36
+ os : [ubuntu-24.04, macos-14, windows-2022]
37
+ runs-on : ${{ matrix.os }}
38
+ timeout-minutes : 10
39
+ steps :
40
+ - uses : actions/checkout@v4
41
+ - run : rustup update stable --no-self-update
42
+ - uses : Swatinem/rust-cache@v2
43
+ # Here we use the latest stable Rust toolchain already installed by GitHub
44
+ # Ideally we should run it for every target, but we cannot rely on unstable toolchains
45
+ # due to Clippy not being consistent between them.
46
+ - run : cargo clippy --workspace --exclude libc-test --exclude ctest-test --all-targets -- -D warnings
47
+
32
48
# This runs `cargo build --target ...` for all T1 and T2 targets`
33
49
verify_build :
34
50
name : Verify build
@@ -287,7 +303,8 @@ jobs:
287
303
- verify_build
288
304
- ctest_msrv
289
305
- docs
290
- # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
306
+ - clippy
307
+ # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
291
308
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
292
309
# dependencies fails.
293
310
if : always() # make sure this is never "skipped"
Original file line number Diff line number Diff line change @@ -142,3 +142,24 @@ members = [
142
142
" ctest-test" ,
143
143
" libc-test" ,
144
144
]
145
+
146
+ # FIXME(msrv): These should be renamed as `[workspace.lints.*]` once MSRV is above 1.64
147
+ # This way all crates can use it with `[lints] workspace=true` section
148
+
149
+ [lints .rust ]
150
+ # FIXME(cleanup): make ident usage consistent in each file
151
+ unused_qualifications = " allow"
152
+
153
+ [lints .clippy ]
154
+ missing_safety_doc = " allow"
155
+
156
+ # FIXME(clippy): all these are default lints and should probably be fixed
157
+ identity_op = " allow"
158
+ if_same_then_else = " allow"
159
+ non_minimal_cfg = " allow"
160
+ precedence = " allow"
161
+ redundant_field_names = " allow"
162
+ redundant_static_lifetimes = " allow"
163
+ unnecessary_cast = " allow"
164
+ unused_unit = " allow"
165
+ zero_ptr = " allow"
Original file line number Diff line number Diff line change @@ -28,3 +28,15 @@ test = false
28
28
[[bin ]]
29
29
name = " t2_cxx"
30
30
test = false
31
+
32
+ # FIXME(msrv): These should be moved to the root Cargo.toml as `[workspace.lints.*]`
33
+ # once MSRV is above 1.64 and replaced with `[lints] workspace=true`
34
+
35
+ [lints .rust ]
36
+ # FIXME(cleanup): make ident usage consistent in each file
37
+ unused_qualifications = " allow"
38
+
39
+ [lints .clippy ]
40
+ # FIXME(clippy): fix these
41
+ match_like_matches_macro = " allow"
42
+ eq_op = " allow"
Original file line number Diff line number Diff line change @@ -13,3 +13,23 @@ garando_syntax = "0.1"
13
13
cc = " 1.0.1"
14
14
rustc_version = " 0.4"
15
15
indoc = " 2.0.6"
16
+
17
+ # FIXME(msrv): These should be moved to the root Cargo.toml as `[workspace.lints.*]`
18
+ # once MSRV is above 1.64 and replaced with `[lints] workspace=true`
19
+
20
+ [lints .rust ]
21
+ # FIXME(cleanup): make ident usage consistent in each file
22
+ unused_qualifications = " allow"
23
+
24
+ [lints .clippy ]
25
+ # FIXME(clippy): fix these
26
+ doc_lazy_continuation = " allow"
27
+ if_same_then_else = " allow"
28
+ needless_borrow = " allow"
29
+ needless_borrowed_reference = " allow"
30
+ needless_borrows_for_generic_args = " allow"
31
+ needless_lifetimes = " allow"
32
+ only_used_in_recursion = " allow"
33
+ option_as_ref_deref = " allow"
34
+ type_complexity = " allow"
35
+ useless_format = " allow"
Original file line number Diff line number Diff line change @@ -102,3 +102,24 @@ harness = true
102
102
name = " style_tests"
103
103
path = " test/style_tests.rs"
104
104
harness = true
105
+
106
+ # FIXME(msrv): These should be moved to the root Cargo.toml as `[workspace.lints.*]`
107
+ # once MSRV is above 1.64 and replaced with `[lints] workspace=true`
108
+
109
+ [lints .rust ]
110
+ # FIXME(cleanup): make ident usage consistent in each file
111
+ unused_qualifications = " allow"
112
+
113
+ [lints .clippy ]
114
+ # FIXME(clippy): fix these
115
+ needless_return = " allow"
116
+ comparison_to_empty = " allow"
117
+ unused_io_amount = " allow"
118
+ write_with_newline = " allow"
119
+ needless_borrows_for_generic_args = " allow"
120
+ only_used_in_recursion = " allow"
121
+ match_like_matches_macro = " allow"
122
+ useless_format = " allow"
123
+ wildcard_in_or_patterns = " allow"
124
+ nonminimal_bool = " allow"
125
+ match_single_binding = " allow"
You can’t perform that action at this time.
0 commit comments