Skip to content

Commit

Permalink
Remove final message and fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen1 committed Jan 17, 2025
1 parent 9376a14 commit bbe91d3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
7 changes: 1 addition & 6 deletions src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
use thiserror::Error;

#[derive(Error, Debug)]
#[derive(Debug, thiserror::Error)]
pub enum StopNaggingError {
#[error("YAML error: {0}")]
Yaml(String),

#[error("File error: {0}")]
File(String),

#[error("Command error: {0}")]
Command(String),
}
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ fn main() {
};

disable_nags(&yaml_config, &args.ecosystems, &args.ignore_tools);

println!("All applicable nags have been disabled (or attempts made).");
std::process::exit(0);
}
1 change: 0 additions & 1 deletion src/runner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::errors::StopNaggingError;
use crate::yaml_config::YamlToolsConfig;
use std::{collections::HashSet, env, process::Command};

Expand Down
12 changes: 3 additions & 9 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ fn test_stop_nagging_cli_with_sample_yaml() {
let mut cmd = Command::cargo_bin("stop-nagging").expect("Binary not found");
cmd.arg("--yaml").arg(sample_yaml);

cmd.assert().success().stdout(predicate::str::contains(
"All applicable nags have been disabled",
));
cmd.assert().success();
}

#[test]
Expand All @@ -39,9 +37,7 @@ fn test_stop_nagging_cli_with_ignore_tools() {
.arg("--ignore-tools")
.arg("echo_test");

cmd.assert().success().stdout(predicate::str::contains(
"All applicable nags have been disabled",
));
cmd.assert().success();
}

#[test]
Expand All @@ -57,7 +53,5 @@ fn test_stop_nagging_cli_with_ecosystems() {
.arg("--ecosystems")
.arg("other");

cmd.assert().success().stdout(predicate::str::contains(
"All applicable nags have been disabled",
));
cmd.assert().success();
}
9 changes: 2 additions & 7 deletions tests/node_e2e_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use assert_cmd::Command;
use predicates::prelude::*;
use std::error::Error;
use std::path::PathBuf;

Expand All @@ -13,9 +12,7 @@ fn test_nodejs_ecosystem_e2e() -> Result<(), Box<dyn Error>> {
let mut cmd = Command::cargo_bin("stop-nagging")?;
cmd.arg("--yaml").arg(node_e2e_yaml.to_str().unwrap());

cmd.assert().success().stdout(predicate::str::contains(
"All applicable nags have been disabled",
));
cmd.assert().success();

Ok(())
}
Expand All @@ -33,9 +30,7 @@ fn test_nodejs_ecosystem_ignore_tools() -> Result<(), Box<dyn Error>> {
.arg("--ignore-tools")
.arg("yarn,pnpm");

cmd.assert().success().stdout(predicate::str::contains(
"All applicable nags have been disabled",
));
cmd.assert().success();

Ok(())
}

0 comments on commit bbe91d3

Please sign in to comment.