pub struct Config {
pub sqrust: SqrustConfig,
pub rules: RulesConfig,
}Expand description
Top-level sqrust.toml structure.
§v0.1.0 — Option A (denylist)
All rules are enabled by default. Use [rules] disable = [...] to turn
specific rules off.
§Planned — Option B (Ruff-style allowlist, v0.2.0)
The fields select and ignore inside [rules] are reserved for a
future allowlist model where you opt into rule categories or individual
rules rather than opting out. When that lands, existing disable configs
will continue to work without changes.
Fields§
§sqrust: SqrustConfig§rules: RulesConfigImplementations§
Source§impl Config
impl Config
Sourcepub fn load(start: &Path) -> Result<Self, String>
pub fn load(start: &Path) -> Result<Self, String>
Load sqrust.toml by walking up from start to the filesystem root.
Returns Config::default() (all rules enabled, no excludes) if no
config file is found.
Sourcepub fn rule_enabled(&self, name: &str) -> bool
pub fn rule_enabled(&self, name: &str) -> bool
Returns true if the rule with this name should run.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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