Skip to content

Commit

Permalink
feat: ability for rules to provide a hash of their internal state
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jul 22, 2024
1 parent f1b63e9 commit d432155
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ pub trait LintRule: std::fmt::Debug + Send + Sync {
fn priority(&self) -> u32 {
0
}

/// A hash of the internal state of the lint rule. This should be a hash
/// of what this lint rule depends on.
///
/// For example, if the lint rules depends on the config file, then this
/// might be a hash of the config file.
fn state_hash(&self) -> u64 {
0
}
}

/// TODO(@magurotuna): remove this after all rules get to use ast_view
Expand Down

0 comments on commit d432155

Please sign in to comment.