pub enum LintKind {
Show 20 variants
Agreement,
BoundaryError,
Capitalization,
Eggcorn,
Enhancement,
Formatting,
Grammar,
Malapropism,
Miscellaneous,
Nonstandard,
Punctuation,
Readability,
Redundancy,
Regionalism,
Repetition,
Spelling,
Style,
Typo,
Usage,
WordChoice,
}
Expand description
The general category a Lint
falls into.
There’s no reason not to add a new item here if you are adding a new rule that doesn’t fit
the existing categories.
Variants§
Agreement
BoundaryError
For errors where words are joined or split at the wrong boundaries (e.g., “each and everyone” vs. “each and every one”)
Capitalization
Eggcorn
For cases where a word or phrase is misused for a similar-sounding word or phrase, where the incorrect version makes logical sense (e.g., ‘egg corn’ for ‘acorn’, ‘on mass’ for ‘en masse’).
Enhancement
For suggesting improvements that enhance clarity or impact without fixing errors
Formatting
Grammar
Malapropism
For cases where a word is mistakenly used for a similar-sounding word with a different meaning (e.g., ‘eluded to’ instead of ‘alluded to’). Unlike eggcorns, these don’t create new meanings.
Miscellaneous
For any other lint that doesn’t fit neatly into the other categories
Nonstandard
Punctuation
For issues with punctuation, including hyphenation in compound adjectives (e.g., “face first” vs. “face-first” when used before a noun)
Readability
Redundancy
For cases where words duplicate meaning that’s already expressed (e.g., “basic fundamentals” → “fundamentals”, “free gift” → “gift”)
Regionalism
For variations that are standard in some regions or dialects but not others
Repetition
Spelling
When your brain doesn’t know the right spelling. This should only be used by linters doing spellcheck on individual words.
Style
For cases where multiple options are correct but one is preferred for style or clarity, such as expanding abbreviations in formal writing (e.g., ‘min’ → ‘minimum’)
Typo
When your brain knows the right spelling but your fingers made a mistake. (e.g., ‘can be seem’ → ‘can be seen’)
Usage
For conventional word usage and standard collocations (e.g., ‘by accident’ vs. ‘on accident’ in standard English)
WordChoice
For choosing between different words or phrases in a given context
Implementations§
Source§impl LintKind
impl LintKind
Sourcepub const fn is_agreement(&self) -> bool
pub const fn is_agreement(&self) -> bool
Returns true
if self
is of variant Agreement
.
Sourcepub const fn is_boundary_error(&self) -> bool
pub const fn is_boundary_error(&self) -> bool
Returns true
if self
is of variant BoundaryError
.
Sourcepub const fn is_capitalization(&self) -> bool
pub const fn is_capitalization(&self) -> bool
Returns true
if self
is of variant Capitalization
.
Sourcepub const fn is_eggcorn(&self) -> bool
pub const fn is_eggcorn(&self) -> bool
Returns true
if self
is of variant Eggcorn
.
Sourcepub const fn is_enhancement(&self) -> bool
pub const fn is_enhancement(&self) -> bool
Returns true
if self
is of variant Enhancement
.
Sourcepub const fn is_formatting(&self) -> bool
pub const fn is_formatting(&self) -> bool
Returns true
if self
is of variant Formatting
.
Sourcepub const fn is_grammar(&self) -> bool
pub const fn is_grammar(&self) -> bool
Returns true
if self
is of variant Grammar
.
Sourcepub const fn is_malapropism(&self) -> bool
pub const fn is_malapropism(&self) -> bool
Returns true
if self
is of variant Malapropism
.
Sourcepub const fn is_miscellaneous(&self) -> bool
pub const fn is_miscellaneous(&self) -> bool
Returns true
if self
is of variant Miscellaneous
.
Sourcepub const fn is_nonstandard(&self) -> bool
pub const fn is_nonstandard(&self) -> bool
Returns true
if self
is of variant Nonstandard
.
Sourcepub const fn is_punctuation(&self) -> bool
pub const fn is_punctuation(&self) -> bool
Returns true
if self
is of variant Punctuation
.
Sourcepub const fn is_readability(&self) -> bool
pub const fn is_readability(&self) -> bool
Returns true
if self
is of variant Readability
.
Sourcepub const fn is_redundancy(&self) -> bool
pub const fn is_redundancy(&self) -> bool
Returns true
if self
is of variant Redundancy
.
Sourcepub const fn is_regionalism(&self) -> bool
pub const fn is_regionalism(&self) -> bool
Returns true
if self
is of variant Regionalism
.
Sourcepub const fn is_repetition(&self) -> bool
pub const fn is_repetition(&self) -> bool
Returns true
if self
is of variant Repetition
.
Sourcepub const fn is_spelling(&self) -> bool
pub const fn is_spelling(&self) -> bool
Returns true
if self
is of variant Spelling
.
Sourcepub const fn is_word_choice(&self) -> bool
pub const fn is_word_choice(&self) -> bool
Returns true
if self
is of variant WordChoice
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LintKind
impl<'de> Deserialize<'de> for LintKind
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>,
impl Copy for LintKind
impl Eq for LintKind
impl StructuralPartialEq for LintKind
Auto Trait Implementations§
impl Freeze for LintKind
impl RefUnwindSafe for LintKind
impl Send for LintKind
impl Sync for LintKind
impl Unpin for LintKind
impl UnwindSafe for LintKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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