Skip to content

Commit deb1979

Browse files
committed
Make limit_stderr_length a subcommand
1 parent 8b9d70d commit deb1979

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

.github/workflows/clippy_dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
run: cargo build --features deny-warnings
3939
working-directory: clippy_dev
4040

41-
- name: Test limit-stderr-length
42-
run: cargo dev --limit-stderr-length
41+
- name: Test limit_stderr_length
42+
run: cargo dev limit_stderr_length
4343

4444
- name: Test update_lints
4545
run: cargo dev update_lints --check

clippy_dev/src/main.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,12 @@ fn main() {
9595
.takes_value(true),
9696
),
9797
)
98-
.arg(
99-
Arg::with_name("limit-stderr-length")
100-
.long("limit-stderr-length")
101-
.help("Ensures that stderr files do not grow longer than a certain amount of lines."),
98+
.subcommand(
99+
SubCommand::with_name("limit_stderr_length")
100+
.about("Ensures that stderr files do not grow longer than a certain amount of lines."),
102101
)
103102
.get_matches();
104103

105-
if matches.is_present("limit-stderr-length") {
106-
stderr_length_check::check();
107-
}
108-
109104
match matches.subcommand() {
110105
("fmt", Some(matches)) => {
111106
fmt::run(matches.is_present("check"), matches.is_present("verbose"));
@@ -129,6 +124,9 @@ fn main() {
129124
Err(e) => eprintln!("Unable to create lint: {}", e),
130125
}
131126
},
127+
("limit_stderr_length", _) => {
128+
stderr_length_check::check();
129+
},
132130
_ => {},
133131
}
134132
}

0 commit comments

Comments
 (0)