Expand description
Run workspace lint suite concurrently (check or fix modes).
Executes lints against the Cargo workspace root auto–detected via ytil_sys::dir::get_workspace_root.
§Behavior
- Auto-detects workspace root (no positional CLI argument required).
- Supports two modes:
- Check (default) runs non-mutating lints.
- Fix (
--fixCLI flag) runs the lints that support automatic fixes.
- Spawns one thread per lint; all run concurrently.
- Result reporting joins threads in declaration order; a long first lint can delay visible output, potentially giving a false impression of serial execution.
- Prints each lint result with: success/error, duration (
time=<Duration>), status code, stripped stdout or error. - Exits with code 1 if any lint command returns a non-zero status, any lint command invocation errors, or any lint thread panics; exits 0 otherwise.
§Returns
- Process exit code communicates aggregate success (0) or failure (1).
§Errors
- Initialization errors from
color_eyre::install. - Workspace root discovery errors from
ytil_sys::dir::get_workspace_root.
§Rationale
Provides a single fast command (usable in git hooks / CI) aggregating core maintenance lints (style, dependency pruning, manifest ordering) without bespoke shell scripting. Split check vs fix modes minimize hook latency while enabling quick remediation. Adds deterministic, ordered reporting for stable output while retaining parallel execution for speed.
Structs§
- Lint
FnResult 🔒 - Newtype wrapper around
Result<LintFnSuccess, LintFnError>.
Enums§
- Lint
FnError 🔒 - Error type for
Lintfunction execution failures. - Lint
FnSuccess 🔒 - Success result from
Lintfunction execution.
Constants§
- LINTS_
CHECK 🔒 - Workspace lint check set.
- LINTS_
FIX 🔒 - Workspace lint fix set.
- LINT_
NO_ 🔒OP - No-operation lint that reports “skipped” status.
Functions§
- build_
conditional_ 🔒lint - Conditionally returns the supplied lint or
LINT_NO_OPbased on file changes. - format_
timing 🔒 - Format lint duration into
time=<duration>snippet (auto-scaled, no color). - main 🔒
- Run workspace lint suite concurrently (check or fix modes).
- report 🔒
- Format and print the result of a completed lint execution.
- run_
and_ 🔒report - Run a single lint, measure its duration, and report immediately.
Type Aliases§
- Lint 🔒
- Function pointer type for a single lint invocation.
- Lint
Builder 🔒 - Function pointer type for building lints based on file changes.