Skip to content

Commit b9fda4f

Browse files
committed
fixed relaxed exit code
1 parent baf5c6e commit b9fda4f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

crates/loq_cli/src/relax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn run_relax<W1: WriteColor, W2: WriteColor>(
4040
Ok(report) => {
4141
if report.is_empty() {
4242
let _ = writeln!(stdout, "No violations to relax");
43-
return ExitStatus::Failure;
43+
return ExitStatus::Success;
4444
}
4545
let _ = write_report(stdout, &report);
4646
ExitStatus::Success

crates/loq_cli/tests/relax.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ max_lines = 700
121121
}
122122

123123
#[test]
124-
fn exits_one_when_no_violations() {
124+
fn exits_zero_when_no_violations() {
125125
let temp = TempDir::new().unwrap();
126126
write_file(&temp, "src/small.rs", &repeat_lines(10));
127127

@@ -131,7 +131,7 @@ fn exits_one_when_no_violations() {
131131
.output()
132132
.unwrap();
133133

134-
assert_eq!(output.status.code(), Some(1));
134+
assert!(output.status.success());
135135
let stdout = strip_ansi(&String::from_utf8_lossy(&output.stdout));
136136
assert!(stdout.contains("No violations to relax"));
137137
}

0 commit comments

Comments
 (0)