Add a note to diagnostics why the rule is enabled (#17854)

This commit is contained in:
Micha Reiser 2025-05-06 20:29:03 +02:00 committed by GitHub
parent 9085f18353
commit b2de749c32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
86 changed files with 184 additions and 3 deletions

View file

@ -505,6 +505,10 @@ impl RuleSelection {
self.lints.get(&lint).map(|(severity, _)| *severity)
}
pub fn get(&self, lint: LintId) -> Option<(Severity, LintSource)> {
self.lints.get(&lint).copied()
}
/// Returns `true` if the `lint` is enabled.
pub fn is_enabled(&self, lint: LintId) -> bool {
self.severity(lint).is_some()