Restore RUF011 documentation (#9758)

For consistency with other redirected rules as in
https://github.com/astral-sh/ruff/pull/9755

Follow-up to #9428
This commit is contained in:
Zanie Blue 2024-02-01 11:48:47 -06:00
parent 994514d686
commit 836d2eaa01
6 changed files with 66 additions and 10 deletions

View file

@ -44,6 +44,20 @@ impl From<Linter> for RuleSelector {
}
}
impl Ord for RuleSelector {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
// TODO(zanieb): We ought to put "ALL" and "Linter" selectors
// above those that are rule specific but it's not critical for now
self.prefix_and_code().cmp(&other.prefix_and_code())
}
}
impl PartialOrd for RuleSelector {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl FromStr for RuleSelector {
type Err = ParseError;