Skip to main content

Crate lanekeep_core

Crate lanekeep_core 

Source
Expand description

Core types and execution engine for lanekeep.

File walking, query evaluation, the facts pipeline, violations, and the Rule trait.

This crate owns the contract every other crate is written against. Rule is treated as public API that happens not to be published: no built-in rule may reach past it into walker internals or cache state, because that boundary is what keeps future rule sources additive. See docs/architecture.md §14.

§What is here so far

Rule identity, severity, source locations, rule cards, violations with their canonical ordering, and the facts a per-file pass hands to the reduce phase.

These types are foundational in a specific sense: they are what appears in JSON output, in cache entries, and in suppression comments users type by hand. Getting them wrong is expensive in a way that getting the walker wrong is not, because only these are visible from outside.

Re-exports§

pub use card::CardProblem;
pub use card::Examples;
pub use card::RuleCard;
pub use changed::ChangeError;
pub use discovery::Discovery;
pub use discovery::DiscoveryError;
pub use fact::Fact;
pub use fix::Fix;
pub use gates::CompiledGates;
pub use gates::GateError;
pub use gates::Gates;
pub use location::FilePath;
pub use location::Location;
pub use location::Position;
pub use rule_id::Namespace;
pub use rule_id::ParseRuleIdError;
pub use rule_id::RuleId;
pub use severity::ParseSeverityError;
pub use severity::Severity;
pub use suppression::Suppression;
pub use suppression::Suppressions;
pub use tracked::ContentHash;
pub use tracked::TrackedRead;
pub use violation::Violation;
pub use violation::any_failing;
pub use violation::sort;

Modules§

card
The rule card.
changed
Selecting files from git, for --since and --staged.
discovery
Finding the files to check.
fact
Facts: what a per-file pass hands to the reduce phase.
fix
Fixes: a replacement a rule offers for what it reported.
gates
Rejecting files before they are read or parsed.
location
Where a violation is.
rule_id
Rule identity.
severity
How much a violation matters.
suppression
Suppression directives: lanekeep-ignore-next-line and lanekeep-ignore-file.
tracked
Tracked effects: what a rule read that was not the file it was checking.
violation
Violations, and the order they are always reported in.