pub struct AstGrepRule<'a> {
pub id: &'a str,
pub language: SupportLang,
pub severity: &'a Severity,
pub message: &'a str,
pub note: Option<&'a str>,
pub rule: &'a Value,
pub constraints: Option<&'a Value>,
pub fix: Option<&'a str>,
pub files: Option<&'a [String]>,
pub ignores: Option<&'a [String]>,
}Expand description
The subset of a slopguard rule that ast-grep understands. slopguard-only
fields (category, fix as free text, tests) are deliberately left out.
Fields§
§id: &'a str§language: SupportLang§severity: &'a Severity§message: &'a str§note: Option<&'a str>§rule: &'a Value§constraints: Option<&'a Value>ast-grep metavariable constraints (sibling of rule). None when the
slopguard rule sets none.
fix: Option<&'a str>ast-grep fix template. Only set by the --fix pass (from the rule’s
rewrite); the detection pass leaves it None.
files: Option<&'a [String]>§ignores: Option<&'a [String]>Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for AstGrepRule<'a>
impl<'a> RefUnwindSafe for AstGrepRule<'a>
impl<'a> Send for AstGrepRule<'a>
impl<'a> Sync for AstGrepRule<'a>
impl<'a> Unpin for AstGrepRule<'a>
impl<'a> UnsafeUnpin for AstGrepRule<'a>
impl<'a> UnwindSafe for AstGrepRule<'a>
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> 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