mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Add rule deprecation infrastructure (#9689)
Adds a new `Deprecated` rule group in addition to `Stable` and `Preview`. Deprecated rules: - Warn on explicit selection without preview - Error on explicit selection with preview - Are excluded when selected by prefix with preview Deprecates `TRY200`, `ANN101`, and `ANN102` as a proof of concept. We can consider deprecating them separately.
This commit is contained in:
parent
c86e14d1d4
commit
a0ef087e73
10 changed files with 279 additions and 21 deletions
|
@ -317,10 +317,18 @@ See also https://github.com/astral-sh/ruff/issues/2186.
|
|||
matches!(self.group(), RuleGroup::Preview)
|
||||
}
|
||||
|
||||
pub fn is_stable(&self) -> bool {
|
||||
matches!(self.group(), RuleGroup::Stable)
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub fn is_nursery(&self) -> bool {
|
||||
matches!(self.group(), RuleGroup::Nursery)
|
||||
}
|
||||
|
||||
pub fn is_deprecated(&self) -> bool {
|
||||
matches!(self.group(), RuleGroup::Deprecated)
|
||||
}
|
||||
}
|
||||
|
||||
impl Linter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue