Skip to content

Commit d6c715b

Browse files
Ryujiyasuclaude
andcommitted
fix(harper-cli): return exit code 0 when no lints are found
The `lint()` function unconditionally called `process::exit(1)`, causing `harper-cli lint` to always exit with code 1 even when no lints were found. This was a regression introduced in PR #2138. Now exits with code 1 only when lints are present, and returns Ok(()) (exit code 0) otherwise. Fixes #2832 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e28a08e commit d6c715b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

harper-cli/src/lint.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ pub fn lint(
268268
}
269269
}
270270

271+
let has_lints = !all_lint_kinds.is_empty();
272+
271273
final_report(
272274
dialect,
273275
true,
@@ -278,7 +280,11 @@ pub fn lint(
278280
lint_options.color,
279281
);
280282

281-
process::exit(1);
283+
if has_lints {
284+
process::exit(1);
285+
}
286+
287+
Ok(())
282288
}
283289

284290
type LintKindCount = HashMap<LintKind, usize>;

0 commit comments

Comments
 (0)