pub struct KubelintConfig {
pub add_all_builtin: bool,
pub do_not_auto_add_defaults: bool,
pub include: Vec<String>,
pub exclude: Vec<String>,
pub ignore_paths: Vec<String>,
pub custom_checks: Vec<CheckSpec>,
pub failure_threshold: Severity,
pub no_fail: bool,
}Expand description
Configuration for the KubeLint linter.
Fields§
§add_all_builtin: boolIf true, add all built-in checks regardless of defaults.
do_not_auto_add_defaults: boolIf true, do not automatically add default checks.
include: Vec<String>List of check names to include (in addition to defaults).
exclude: Vec<String>List of check names to exclude.
ignore_paths: Vec<String>Glob patterns for paths to ignore.
custom_checks: Vec<CheckSpec>Custom check definitions.
failure_threshold: SeverityMinimum severity to report. Checks below this threshold are filtered.
no_fail: boolIf true, never return a non-zero exit code.
Implementations§
Source§impl KubelintConfig
impl KubelintConfig
Sourcepub fn ignore_path(self, pattern: impl Into<String>) -> Self
pub fn ignore_path(self, pattern: impl Into<String>) -> Self
Add a path pattern to ignore.
Sourcepub fn with_threshold(self, threshold: Severity) -> Self
pub fn with_threshold(self, threshold: Severity) -> Self
Set the failure threshold.
Sourcepub fn with_all_builtin(self) -> Self
pub fn with_all_builtin(self) -> Self
Enable all built-in checks.
Sourcepub fn without_defaults(self) -> Self
pub fn without_defaults(self) -> Self
Disable automatic default checks.
Sourcepub fn is_check_excluded(&self, check_name: &str) -> bool
pub fn is_check_excluded(&self, check_name: &str) -> bool
Check if a check is explicitly excluded.
Sourcepub fn is_check_included(&self, check_name: &str) -> bool
pub fn is_check_included(&self, check_name: &str) -> bool
Check if a check is explicitly included.
Sourcepub fn resolve_checks<'a>(
&self,
available: &'a [CheckSpec],
) -> Vec<&'a CheckSpec>
pub fn resolve_checks<'a>( &self, available: &'a [CheckSpec], ) -> Vec<&'a CheckSpec>
Get the effective set of check names to run.
This resolves includes/excludes against the available checks.
Sourcepub fn should_ignore_path(&self, path: &Path) -> bool
pub fn should_ignore_path(&self, path: &Path) -> bool
Check if a file path should be ignored based on ignore_paths patterns.
Sourcepub fn load_from_file(path: &Path) -> Result<Self, ConfigError>
pub fn load_from_file(path: &Path) -> Result<Self, ConfigError>
Load configuration from a YAML file.
Sourcepub fn load_from_str(content: &str) -> Result<Self, ConfigError>
pub fn load_from_str(content: &str) -> Result<Self, ConfigError>
Load configuration from a YAML string.
Sourcepub fn load_from_default() -> Option<Self>
pub fn load_from_default() -> Option<Self>
Try to load config from default locations (.kube-linter.yaml, .kube-linter.yml).
Trait Implementations§
Source§impl Clone for KubelintConfig
impl Clone for KubelintConfig
Source§fn clone(&self) -> KubelintConfig
fn clone(&self) -> KubelintConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KubelintConfig
impl Debug for KubelintConfig
Source§impl Default for KubelintConfig
impl Default for KubelintConfig
Source§impl<'de> Deserialize<'de> for KubelintConfig
impl<'de> Deserialize<'de> for KubelintConfig
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>,
Auto Trait Implementations§
impl Freeze for KubelintConfig
impl RefUnwindSafe for KubelintConfig
impl Send for KubelintConfig
impl Sync for KubelintConfig
impl Unpin for KubelintConfig
impl UnwindSafe for KubelintConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more