pub struct Config {
pub ignore: Vec<String>,
pub graphs: BTreeMap<String, GraphConfig>,
pub rules: HashMap<String, RuleConfig>,
pub config_dir: Option<PathBuf>,
}Fields§
§ignore: Vec<String>Glob patterns the fs walk removes from the graph (also respects
.gitignore).
graphs: BTreeMap<String, GraphConfig>Configured graphs, keyed by name. fs is implicit and always built.
rules: HashMap<String, RuleConfig>§config_dir: Option<PathBuf>Directory containing the drft.toml this config was loaded from.
Implementations§
Source§impl Config
impl Config
Sourcepub fn defaults() -> Self
pub fn defaults() -> Self
The base config: no graphs (the drft.toml declares the full set), no
ignores, every rule at warn. fs is always built regardless.
pub fn load(root: &Path) -> Result<Self>
Sourcepub fn ignore_patterns(&self) -> &[String]
pub fn ignore_patterns(&self) -> &[String]
Glob patterns the fs walk removes from the graph.
Sourcepub fn is_rule_ignored(&self, rule: &str, path: &str) -> bool
pub fn is_rule_ignored(&self, rule: &str, path: &str) -> bool
Whether path is ignored for rule.
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