pub struct Config {
pub ignore: Vec<String>,
pub interface: Option<InterfaceConfig>,
pub parsers: HashMap<String, ParserConfig>,
pub rules: HashMap<String, RuleConfig>,
pub config_dir: Option<PathBuf>,
}Fields§
§ignore: Vec<String>§interface: Option<InterfaceConfig>§parsers: HashMap<String, ParserConfig>§rules: HashMap<String, RuleConfig>§config_dir: Option<PathBuf>Directory containing the drft.toml this config was loaded from.
Implementations§
Source§impl Config
impl Config
pub fn defaults() -> Self
pub fn load(root: &Path) -> Result<Self>
pub fn rule_severity(&self, name: &str) -> RuleSeverity
Sourcepub fn is_rule_ignored(&self, rule: &str, path: &str) -> bool
pub fn is_rule_ignored(&self, rule: &str, path: &str) -> bool
Check if a path should be ignored for a specific rule.
Sourcepub fn script_rules(&self) -> impl Iterator<Item = (&str, &RuleConfig)>
pub fn script_rules(&self) -> impl Iterator<Item = (&str, &RuleConfig)>
Get script rules (rules with a command field).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more