refactor(linter): rename Rule trait method params (#5617)

Makes no real difference. Just produces nicer naming hints in IDEs.
This commit is contained in:
overlookmotel 2024-09-08 18:36:36 +00:00
parent 4e748b5930
commit afea8d5dea

View file

@ -16,13 +16,16 @@ pub trait Rule: Sized + Default + fmt::Debug {
}
/// Visit each AST Node
fn run<'a>(&self, _node: &AstNode<'a>, _ctx: &LintContext<'a>) {}
#[expect(unused_variables)]
fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {}
/// Visit each symbol
fn run_on_symbol(&self, _symbol_id: SymbolId, _ctx: &LintContext<'_>) {}
#[expect(unused_variables)]
fn run_on_symbol(&self, symbol_id: SymbolId, ctx: &LintContext<'_>) {}
/// Run only once. Useful for inspecting scopes and trivias etc.
fn run_once(&self, _ctx: &LintContext) {}
#[expect(unused_variables)]
fn run_once(&self, ctx: &LintContext) {}
/// Check if a rule should be run at all.
///
@ -31,7 +34,8 @@ pub trait Rule: Sized + Default + fmt::Debug {
/// enabled/disabled; this is handled by the [`linter`].
///
/// [`linter`]: crate::Linter
fn should_run(&self, _ctx: &LintContext) -> bool {
#[expect(unused_variables)]
fn should_run(&self, ctx: &LintContext) -> bool {
true
}
}