pub struct LintConfiguration {
pub options: LintRuleConfiguration,
pub groups: Vec<LintGroup>,
pub disabled_rules: Vec<String>,
pub enabled_rules: Vec<String>,
}
Expand description
Configuration options for linting.
The options allow to
- configure the general lint rule behavior,
- explicitly enable or disable individual lint rules,
- and enable non-default lint groups.
Fields§
§options: LintRuleConfiguration
All options that can be used to configure various lint rules.
groups: Vec<LintGroup>
All non-default groups that are additionally enabled.
disabled_rules: Vec<String>
A list of lint rules that are explicitly disabled.
enabled_rules: Vec<String>
A list of lint rules that are explicitly enabled.
Implementations§
Source§impl LintConfiguration
impl LintConfiguration
Sourcepub fn from_path(path: &Path) -> Result<Self, Error>
pub fn from_path(path: &Path) -> Result<Self, Error>
Loads a LintConfiguration
from a TOML configuration file.
Reads the file at the specified path and parses it as TOML to create a configuration instance.
§Examples
use alpm_lint_config::LintConfiguration;
// Load configuration from a TOML file containing the default configuration.
let config = LintConfiguration::from_path(&config_path)?;
// The configuration is now available for use
assert_eq!(config, LintConfiguration::default());
§Errors
Returns an error if:
- the file at
path
cannot be opened for reading, - the file contents cannot be read,
- or the file contents cannot be parsed as valid TOML.
Trait Implementations§
Source§impl Clone for LintConfiguration
impl Clone for LintConfiguration
Source§fn clone(&self) -> LintConfiguration
fn clone(&self) -> LintConfiguration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LintConfiguration
impl Debug for LintConfiguration
Source§impl Default for LintConfiguration
impl Default for LintConfiguration
Source§fn default() -> LintConfiguration
fn default() -> LintConfiguration
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LintConfiguration
impl<'de> Deserialize<'de> for LintConfiguration
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
Source§impl PartialEq for LintConfiguration
impl PartialEq for LintConfiguration
Source§impl Serialize for LintConfiguration
impl Serialize for LintConfiguration
impl StructuralPartialEq for LintConfiguration
Auto Trait Implementations§
impl Freeze for LintConfiguration
impl RefUnwindSafe for LintConfiguration
impl Send for LintConfiguration
impl Sync for LintConfiguration
impl Unpin for LintConfiguration
impl UnwindSafe for LintConfiguration
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