Skip to content

fix(cli): fail lint when rule violations are reported - #326

Open
bandstacker wants to merge 1 commit into
helsing-ai:mainfrom
bandstacker:fix/lint-exit-status
Open

bandstacker wants to merge 1 commit into
helsing-ai:mainfrom
bandstacker:fix/lint-exit-status

Conversation

@bandstacker

Copy link
Copy Markdown

Summary

  • Make buffrs lint exit non-zero when it reports error-level rule violations.
  • Warnings are still printed and do not fail the command unless --deny warnings is passed. --allow warnings keeps that default.
  • Drop a redundant borrow so current stable Clippy stays clean.

Why

lint printed violations and then returned success, so CI could not use the command as a gate. Violations go to stderr, which also makes a stdout grep miss them.

Fixes #322

Test plan

  • cargo test --test e2e cmd::lint
  • cargo test --lib validation::violation::tests
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --workspace -- -D warnings -D clippy::all

lint printed violations and still returned success, so CI could not use it as a gate. Error-level violations now fail the command.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buffrs lint exits 0 on rule violations

1 participant