Skip to main content

Crate pedant_core

Crate pedant_core 

Source
Expand description

Analysis engine for pedant: IR extraction, style checks, and capability detection.

pedant-core provides the core analysis pipeline without CLI dependencies. Parse Rust source, extract an intermediate representation, run style checks, and detect capability usage — all without pulling in clap or output formatting.

§Quick start

use pedant_core::{lint_str, Config};

let config = Config::default();
let result = lint_str("fn f() { if true { if false {} } }", &config).unwrap();
assert!(!result.violations.is_empty());

Re-exports§

pub use analysis_result::AnalysisResult;
pub use check_config::CheckConfig as Config;
pub use check_config::ConfigFile;
pub use check_config::GateConfig;
pub use check_config::GateRuleOverride;
pub use check_config::NamingCheck;
pub use check_config::PatternCheck;
pub use check_config::PatternOverride;
pub use checks::ALL_CHECKS;
pub use checks::CheckInfo;
pub use gate::GateRuleInfo;
pub use gate::GateSeverity;
pub use gate::GateVerdict;
pub use gate::all_gate_rules;
pub use gate::evaluate_gate_rules;
pub use lint::LintError;
pub use lint::analyze;
pub use lint::analyze_build_script;
pub use lint::analyze_with_build_script;
pub use lint::determine_analysis_tier;
pub use lint::discover_build_script;
pub use lint::discover_workspace_root;
pub use lint::lint_file;
pub use lint::lint_str;
pub use violation::CheckRationale;
pub use violation::Violation;
pub use violation::ViolationType;
pub use violation::lookup_rationale;
pub use ir::semantic::SemanticContext;

Modules§

analysis_result
Violations + capabilities produced by a single analysis run.
capabilities
Path-based capability detection over extracted IR facts.
check_config
.pedant.toml schema, loading, and per-path override resolution.
checks
Check catalog: metadata, rationale, and the ViolationType enum.
gate
Security gate rules that fire on suspicious capability combinations. Gate rules engine: evaluates capability profiles and data flows against security rules.
hash
SHA-256 hashing of source contents for attestation.
ir
Intermediate representation extracted from the AST in one pass.
json_format
JSON serialization for machine-readable violation output.
lint
High-level analysis entry points and error types.
pattern
Glob and wildcard matching for AST node text and file paths.
style
Style checks that consume IR facts and produce violations.
violation
The Violation type, display formatting, and check rationale.

Structs§

ParseError
Alias for syn::Error, used by consumers that call analyze directly. Error returned when a Syn parser cannot parse the input tokens.