Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kraktus committed Oct 26, 2022
1 parent 00ba11a commit 1720b5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
28 changes: 16 additions & 12 deletions lintcheck/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ fn get_clap_config() -> ArgMatches {
.conflicts_with("fix"),
Arg::new("verbose")
.short('v')
.long("--verbose")
.action(ArgAction::Count)
.help("Verbosity to use, default to WARN")
.help("Verbosity to use, default to WARN"),
])
.get_matches()
}
Expand Down Expand Up @@ -74,17 +75,20 @@ impl LintcheckConfig {
let clap_config = get_clap_config();
let mut builder = Builder::new();
builder
.filter(
None,
match clap_config.get_count("verbose") {
0 => LevelFilter::Warn,
1 => LevelFilter::Info,
2 => LevelFilter::Debug,
_ => LevelFilter::Trace,
},
)
.default_format()
.init();
.filter(
None,
match clap_config.get_count("verbose") {
0 => LevelFilter::Warn,
1 => LevelFilter::Info,
2 => dbg!(LevelFilter::Debug),
_ => LevelFilter::Trace,
},
)
.default_format()
.init();
assert_eq!(clap_config.get_count("verbose"), 2);
log::debug!("Test");
println!("{:?}", builder);

// first, check if we got anything passed via the LINTCHECK_TOML env var,
// if not, ask clap if we got any value for --crates-toml <foo>
Expand Down
4 changes: 1 addition & 3 deletions lintcheck/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ impl Crate {
let status = &all_output.status;

if !status.success() {
warn!("bad exit status after checking {} {} \n",
self.name, self.version
);
warn!("bad exit status after checking {} {} \n", self.name, self.version);
}

if config.fix {
Expand Down

0 comments on commit 1720b5b

Please sign in to comment.