feat: add first-class cargo-crap integration#235
Merged
Conversation
### Summary Add an opt-in cargo-crap pre-commit gate to the existing flakebox cargo-crap integration without making expensive CRAP checks run by default. The hook is generated only when `cargo-crap.pre-commit.enable = true`, and projects can customize the cargo-crap CLI arguments through Nix configuration. ### Details The new `cargo-crap.pre-commit.args` option defaults to `--workspace --fail-above`, using thresholds from the generated `.cargo-crap.toml`, while allowing projects to add coverage, baseline, or stricter threshold arguments. The hook runs `cargo-crap` directly through `flakebox-in-each-cargo-workspace` for consistency with existing cargo pre-commit workspace handling. The change also clarifies cargo-crap option descriptions, gives `just crap` the usual bash/root guard, adds human docs and flakeboxLib docs, and adds module regression coverage for default, disabled, config-disabled, and pre-commit-enabled cases. Validation and independent review passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR published by Tau
Summary
Add first-class cargo-crap support to flakebox and an opt-in pre-commit cargo-crap gate. This makes cargo-crap available like the other supported Rust/dev tooling, with generated defaults and documented configuration.
Details
This packages cargo-crap, exposes it through flakebox outputs/lib, adds a default-enabled cargo-crap module that installs the tool in dev shells and generates
.cargo-crap.toml, and addsjust crap. It also adds opt-incargo-crap.pre-commit.*options for projects that want a generated gate in their pre-commit hook.