File tree 3 files changed +16
-21
lines changed
3 files changed +16
-21
lines changed Original file line number Diff line number Diff line change 58
58
59
59
- name : Run lintcheck
60
60
if : steps.cache-json.outputs.cache-hit != 'true'
61
- run : ./target/debug/lintcheck --format json --warn- all --crates-toml ./lintcheck/ci_crates.toml
61
+ run : ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
62
62
63
63
- name : Upload base JSON
64
64
uses : actions/upload-artifact@v4
86
86
run : cargo build --manifest-path=lintcheck/Cargo.toml
87
87
88
88
- name : Run lintcheck
89
- run : ./target/debug/lintcheck --format json --warn- all --crates-toml ./lintcheck/ci_crates.toml
89
+ run : ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
90
90
91
91
- name : Upload head JSON
92
92
uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -33,13 +33,13 @@ pub(crate) struct LintcheckConfig {
33
33
/// Runs cargo clippy --fix and checks if all suggestions apply
34
34
#[ clap( long, conflicts_with( "max_jobs" ) ) ]
35
35
pub fix : bool ,
36
- /// Apply a filter to only collect specified lints, this also overrides `allow` attributes
36
+ /// Apply a filter to only collect specified lints
37
37
#[ clap( long = "filter" , value_name = "clippy_lint_name" , use_value_delimiter = true ) ]
38
38
pub lint_filter : Vec < String > ,
39
- /// Set all lints to the "warn" lint level, even resitriction ones. Usually,
40
- /// it's better to use `--filter` instead
39
+ /// Check all Clippy lints, by default only `clippy::all` and `clippy::pedantic` are checked.
40
+ /// Usually, it's better to use `--filter` instead
41
41
#[ clap( long, conflicts_with( "lint_filter" ) ) ]
42
- pub warn_all : bool ,
42
+ pub all_lints : bool ,
43
43
/// Set the output format of the log file
44
44
#[ clap( long, short, default_value = "text" ) ]
45
45
pub format : OutputFormat ,
Original file line number Diff line number Diff line change @@ -284,29 +284,24 @@ fn lintcheck(config: LintcheckConfig) {
284
284
let ( crates, recursive_options) = read_crates ( & config. sources_toml_path ) ;
285
285
286
286
let counter = AtomicUsize :: new ( 1 ) ;
287
- let mut lint_level_args: Vec < String > = vec ! [ ] ;
287
+ let mut lint_level_args: Vec < String > = vec ! [ "--cap-lints=allow" . into ( ) ] ;
288
288
if config. lint_filter . is_empty ( ) {
289
- lint_level_args. push ( "--cap-lints=warn" . to_string ( ) ) ;
290
-
291
- // Set allow-by-default to warn
292
- if config. warn_all {
293
- [
289
+ let groups = if config. all_lints {
290
+ & [
291
+ "clippy::all" ,
294
292
"clippy::cargo" ,
295
293
"clippy::nursery" ,
296
294
"clippy::pedantic" ,
297
295
"clippy::restriction" ,
298
- ]
296
+ ] [ ..]
297
+ } else {
298
+ & [ "clippy::all" , "clippy::pedantic" ]
299
+ } ;
300
+ groups
299
301
. iter ( )
300
- . map ( |group| format ! ( "--warn={group}" ) )
302
+ . map ( |group| format ! ( "--force- warn={group}" ) )
301
303
. collect_into ( & mut lint_level_args) ;
302
- } else {
303
- [ "clippy::cargo" , "clippy::pedantic" ]
304
- . iter ( )
305
- . map ( |group| format ! ( "--warn={group}" ) )
306
- . collect_into ( & mut lint_level_args) ;
307
- }
308
304
} else {
309
- lint_level_args. push ( "--cap-lints=allow" . to_string ( ) ) ;
310
305
config
311
306
. lint_filter
312
307
. iter ( )
You can’t perform that action at this time.
0 commit comments