Skip to content

Commit

Permalink
Fix bug resulting in unused always returning an exit status of 1
Browse files Browse the repository at this point in the history
What?
=====

This fixes a bug with unused where any results run returns an exit
status of 1 if any tokens are present in the codebase.
  • Loading branch information
joshuaclayton committed Jan 7, 2022
1 parent f4daa8e commit b299edf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ pub fn run() {
Some(flags::Command::DefaultYaml) => println!("{}", ProjectConfigurations::default_yaml()),
None => match Token::all() {
Ok((_, results)) => {
if results.is_empty() {
CliConfiguration::new(&flags, vec![]).render()
} else {
CliConfiguration::new(&flags, results).render();
if flags.harsh {
process::exit(1);
}
let configuration = CliConfiguration::new(&flags, results);
configuration.render();
if flags.harsh && !configuration.analyses().is_empty() {
process::exit(1);
}
}
Err(e) => {
Expand Down

0 comments on commit b299edf

Please sign in to comment.