pub struct LintConfig {
pub rules: BTreeMap<String, Level>,
pub strict: Option<bool>,
}Expand description
Fields§
§rules: BTreeMap<String, Level>[lint.rules] — the level of each rule this project has an opinion about.
A key is any entry of crate::lint::RULES — one of htl’s own rules,
or one of the vendored Teal compiler’s warning kinds under its tl: prefix
("tl:hint", "tl:unused", …, which have to be quoted because : is not a bare
TOML key). htl check --list-lints prints them all with their defaults. A value is
"allow", "warn" or "deny". An unknown name or level is refused rather than
ignored: a typo that turned nothing on would read exactly like a rule that found
nothing, and a misspelt "deny" would read like a run that passed.
One place per rule says everything about that rule. The enable / disable lists
this replaced said it in two places that had to be read together, and neither could
say what a rule was worth. A rule this table does not name keeps its default level.
strict: Option<bool>true: every finding this run reports at warn counts as deny, so Teal’s
warnings and htl’s lints fail htl check; lints also fail include_tl! (the macro
reports Teal’s warnings and builds anyway). false: advisory everywhere (including
the macro, whose built-in default is strict), except for a rule the project set to
deny, which fails htl check with or without this key.
A run-wide promotion rather than a concept of its own: strict and a [lint.rules]
level are the same question asked at two grains.
htl test does not read it, by design: a test run’s verdict is its tests, plus
the type errors that stop a file from running at all. Warnings and lints are
still reported there; htl check is where they are judged.
Trait Implementations§
Source§impl Clone for LintConfig
impl Clone for LintConfig
Source§fn clone(&self) -> LintConfig
fn clone(&self) -> LintConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LintConfig
impl Debug for LintConfig
Source§impl Default for LintConfig
impl Default for LintConfig
Source§fn default() -> LintConfig
fn default() -> LintConfig
Source§impl<'de> Deserialize<'de> for LintConfig
impl<'de> Deserialize<'de> for LintConfig
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 LintConfig
impl RefUnwindSafe for LintConfig
impl Send for LintConfig
impl Sync for LintConfig
impl Unpin for LintConfig
impl UnsafeUnpin for LintConfig
impl UnwindSafe for LintConfig
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> 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