Skip to main content

Module command_idempotent

Module command_idempotent 

Source
Expand description

command_idempotent — a declared check-mode command must be a no-op. The check-mode-idempotence sibling of generated_file_fresh: run a user-declared formatter/checker in its --check mode once (single-shot); exit 0 = formatter-clean, non-zero = violation(s). Optional files_from / files_pattern attributes per-file violations from the tool’s own offender list. alint never runs a mutating formatter and never writes the working tree itself.

Same trust tier as the command / generated_file_fresh rules: it spawns a user-supplied process, so it is trust-gated at config load by alint_dsl::reject_command_rules_in — only the user’s own top-level config may declare it; an extends:’d ruleset (local / HTTPS / alint://bundled/) declaring it is refused. Design + open-question resolutions: docs/design/v0.10/command_idempotent.md.

- id: code-is-formatted
  kind: command_idempotent
  command: ["cargo", "fmt", "--all", "--", "--check"]
  workdir: "."                       # default: lint root
  files_from: stderr                 # none (default) | stdout | stderr
  files_pattern: "Diff in (.+) at"   # optional regex, group 1 = path
  level: error

Structs§

CommandIdempotentRule

Functions§

build