pub struct Config {
pub version: u32,
pub extends: Vec<ExtendsEntry>,
pub ignore: Vec<String>,
pub respect_gitignore: bool,
pub vars: HashMap<String, String>,
pub facts: Vec<FactSpec>,
pub rules: Vec<RuleSpec>,
pub fix_size_limit: Option<u64>,
pub nested_configs: bool,
pub allow_out_of_root: AllowOutOfRoot,
}Expand description
Parsed form of a .alint.yml file.
Fields§
§version: u32§extends: Vec<ExtendsEntry>Other config files this one inherits from. Entries resolved left-to-right; later entries override earlier ones; the current file’s own definitions override everything it extends.
Each entry is either a bare string (local path, https://
URL with SRI, or alint://bundled/...) or a mapping with
url: and optional only: / except: filters.
ignore: Vec<String>§respect_gitignore: bool§vars: HashMap<String, String>Free-form string variables referenced from rule messages and
when expressions as {{vars.<name>}} and vars.<name>.
facts: Vec<FactSpec>Repository properties evaluated once per run and referenced from
when clauses as facts.<id>.
rules: Vec<RuleSpec>§fix_size_limit: Option<u64>Maximum file size, in bytes, that content-editing fixes
will read and rewrite. Files over this limit are reported
as Skipped in the fix report and a one-line warning is
printed to stderr. Defaults to 1 MiB; set explicitly to
null to disable the cap entirely.
Path-only fixes (file_create, file_remove,
file_rename) ignore the cap — they don’t read content.
nested_configs: boolOpt in to discovery of .alint.yml / .alint.yaml files
in subdirectories. When true, the loader walks the
repository tree (from the root config’s directory,
respecting .gitignore and ignore:) and finds any
nested config files; each nested rule’s path-like fields
(paths, select, primary) are prefixed with the
directory that nested config lives in, so the rule
auto-scopes to that subtree. Default false.
Only the user’s top-level config may set this — nested configs themselves cannot spawn further nested discovery.
allow_out_of_root: AllowOutOfRootResolved allow_out_of_root: policy — which rules may read a
config-declared path that escapes the repo root. Set by the
loader’s finalize() from the user’s top-level config only
(rejected from extends:); #[serde(skip)] so a directly
deserialized or bundled Config can never set it. Default
AllowOutOfRoot::Confined. See
docs/design/v0.12/allow_out_of_root.md.
Implementations§
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>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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