Crate tec

Crate tec 

Source
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 (--fix CLI 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

§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§

LintFnResult 🔒
Newtype wrapper around Result<LintFnSuccess, LintFnError>.

Enums§

LintFnError 🔒
Error type for Lint function execution failures.
LintFnSuccess 🔒
Success result from Lint function 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_OP based 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.
LintBuilder 🔒
Function pointer type for building lints based on file changes.