mod builtin;
mod loader;
pub mod query;
mod runner;
mod sources;
#[cfg(feature = "cli")]
pub mod service;
pub use builtin::BUILTIN_RULES;
pub use loader::{RuleOverride, RulesConfig, load_all_rules, parse_rule_content};
pub use query::{MatchResult, is_sexp_pattern, run_astgrep_query, run_sexp_query};
#[cfg(feature = "fix")]
pub use runner::apply_fixes;
pub use runner::{DebugFlags, Finding, evaluate_predicates, run_rules};
pub use sources::{
EnvSource, GitSource, GoSource, PathSource, PythonSource, RuleSource, RustSource,
SourceContext, SourceRegistry, TypeScriptSource, builtin_registry,
};
pub use normalize_rules_config::Severity;
use glob::Pattern;
use std::collections::HashMap;
use std::path::PathBuf;
#[derive(Debug)]
pub struct Rule {
pub id: String,
pub query_str: String,
pub severity: Severity,
pub message: String,
pub allow: Vec<Pattern>,
pub files: Vec<Pattern>,
pub source_path: PathBuf,
pub languages: Vec<String>,
pub enabled: bool,
pub builtin: bool,
pub requires: HashMap<String, String>,
pub fix: Option<String>,
pub tags: Vec<String>,
pub doc: Option<String>,
pub recommended: bool,
pub applies_in_tests: bool,
}
pub struct BuiltinRule {
pub id: &'static str,
pub content: &'static str,
}