Make limit_stderr_length a subcommand

This commit is contained in:
flip1995 2020-03-31 15:13:38 +02:00
parent 8b9d70d349
commit deb1979b8e
No known key found for this signature in database
GPG Key ID: 2CEFCDB27ED0BE79
2 changed files with 8 additions and 10 deletions

View File

@ -38,8 +38,8 @@ jobs:
run: cargo build --features deny-warnings
working-directory: clippy_dev
- name: Test limit-stderr-length
run: cargo dev --limit-stderr-length
- name: Test limit_stderr_length
run: cargo dev limit_stderr_length
- name: Test update_lints
run: cargo dev update_lints --check

View File

@ -95,17 +95,12 @@ fn main() {
.takes_value(true),
),
)
.arg(
Arg::with_name("limit-stderr-length")
.long("limit-stderr-length")
.help("Ensures that stderr files do not grow longer than a certain amount of lines."),
.subcommand(
SubCommand::with_name("limit_stderr_length")
.about("Ensures that stderr files do not grow longer than a certain amount of lines."),
)
.get_matches();
if matches.is_present("limit-stderr-length") {
stderr_length_check::check();
}
match matches.subcommand() {
("fmt", Some(matches)) => {
fmt::run(matches.is_present("check"), matches.is_present("verbose"));
@ -129,6 +124,9 @@ fn main() {
Err(e) => eprintln!("Unable to create lint: {}", e),
}
},
("limit_stderr_length", _) => {
stderr_length_check::check();
},
_ => {},
}
}