pub struct RuleTests {
pub should_match: Vec<String>,
pub should_not_match: Vec<String>,
pub should_fix: Vec<FixCase>,
pub should_match_files: Vec<String>,
pub should_not_match_files: Vec<String>,
}Fields§
§should_match: Vec<String>§should_not_match: Vec<String>§should_fix: Vec<FixCase>Rewrite assertions checked by slopguard test for autofixable rules.
Each case’s before is rewritten with the rule’s rewrite and must
equal after. Ignored for rules that are not autofixable.
should_match_files: Vec<String>Whole-file fixtures for metric rules, resolved against the embedded ruleset root (builtin rules) or the custom rule directory the rule was loaded from. A metric cannot be measured on a snippet.
should_not_match_files: Vec<String>Trait Implementations§
Source§impl<'de> Deserialize<'de> for RuleTests
impl<'de> Deserialize<'de> for RuleTests
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 RuleTests
impl RefUnwindSafe for RuleTests
impl Send for RuleTests
impl Sync for RuleTests
impl Unpin for RuleTests
impl UnsafeUnpin for RuleTests
impl UnwindSafe for RuleTests
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
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> ⓘ
Converts
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> ⓘ
Converts
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