pub struct Config {
pub scan: ScanConfig,
pub watch: WatchConfig,
pub text_files: TextFilesConfig,
pub ignore: IgnoreConfig,
pub disabled_rules: HashSet<String>,
pub rules: Vec<YamlRule>,
pub malware_signatures: Vec<MalwareSignature>,
}Expand description
Main configuration structure for cc-audit
Fields§
§scan: ScanConfigScan configuration (CLI options)
watch: WatchConfigWatch mode configuration
text_files: TextFilesConfigText file detection configuration
ignore: IgnoreConfigIgnore configuration for scanning
disabled_rules: HashSet<String>Rule IDs to disable
rules: Vec<YamlRule>Custom rules defined in config file
malware_signatures: Vec<MalwareSignature>Custom malware signatures defined in config file
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_file(path: &Path) -> Result<Self, ConfigError>
pub fn from_file(path: &Path) -> Result<Self, ConfigError>
Load configuration from a file
Sourcepub fn load(project_root: Option<&Path>) -> Self
pub fn load(project_root: Option<&Path>) -> Self
Load configuration from the project directory or global config
Search order:
.cc-audit.yamlin project root.cc-audit.jsonin project root.cc-audit.tomlin project root~/.config/cc-audit/config.yaml- Default configuration
Sourcepub fn generate_template() -> String
pub fn generate_template() -> String
Generate a YAML configuration template with comments
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 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