Skip to main content

Crate alint_core

Crate alint_core 

Source
Expand description

alint-core — engine, walker, rule trait, config AST.

See docs/design/ARCHITECTURE.md in the alint repository for the rule model, execution order, and crate layout rationale.

Re-exports§

pub use facts::FactKind;
pub use facts::FactSpec;
pub use facts::FactValue;
pub use facts::FactValues;
pub use facts::evaluate_facts;
pub use when::WhenEnv;
pub use when::WhenError;
pub use when::WhenExpr;

Modules§

facts
Facts — cached properties of the repository evaluated once per run and referenced by when clauses on rules (shipping in a later commit).
template
String substitution for path templates and message templates.
when
The when expression language — bounded DSL for gating rules on facts.

Structs§

Config
Parsed form of a .alint.yml file.
Context
Execution context handed to each rule during evaluation.
Engine
Executes a set of rules against a pre-built FileIndex.
FileAppendFixSpec
FileCreateFixSpec
FileEntry
A single filesystem entry discovered by the walker.
FileIndex
The indexed result of one filesystem walk. All rules share this index — the walk happens once per alint check invocation.
FilePrependFixSpec
FileRemoveFixSpec
FileRenameFixSpec
Empty marker: file_rename takes no parameters. The target name is derived from the parent rule (e.g. filename_case converts the stem to its configured case; the extension is preserved).
FixContext
Runtime context for applying a fix.
FixItem
FixReport
Outcome of running Engine::fix against a repository. One FixRuleResult per rule that produced violations; rules that passed are omitted.
FixRuleResult
NestedRuleSpec
Rule specification for nested rules (e.g. the require: block of for_each_dir). Unlike RuleSpec, id and level are synthesized from the parent rule — users just supply the kind plus kind-specific options, optionally with a message / policy_url / when.
Report
RuleEntry
A rule bundled with an optional when expression. Rules with a when that evaluates to false at runtime are skipped (no RuleResult is produced) — same observable effect as level: off, but gated on facts.
RuleRegistry
Map from kind string → factory function. Built-in rule crates register themselves here at startup, and plugin rules (in later phases) will too.
RuleResult
The collected outcome of evaluating a single rule.
RuleSpec
YAML-level description of a rule before it is instantiated into a Box<dyn Rule> by a RuleBuilder.
Scope
Compiled include/exclude matcher built from a PathsSpec or raw pattern list.
Violation
A single linting violation produced by a rule.
WalkOptions

Enums§

Error
FixOutcome
The result of applying (or simulating) one fix against one violation.
FixSpec
The fix: block on a rule. Exactly one op key must be present — alint errors at load time when the op and rule kind are incompatible.
FixStatus
Level
PathsSpec
YAML shape for a rule’s paths: field — a single glob, an array (with optional !pattern negations), or an explicit {include, exclude} pair. For the include/exclude form, each field accepts either a single string or a list of strings.

Traits§

Fixer
A mechanical corrector for a specific rule’s violations.
Rule
Trait every built-in and plugin rule implements.

Functions§

walk

Type Aliases§

Result
RuleBuilder