mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 04:55:09 +00:00
Add a note to diagnostics why the rule is enabled (#17854)
This commit is contained in:
parent
9085f18353
commit
b2de749c32
86 changed files with 184 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue