[pylint] Implement nan-comparison (PLW0117) (#10401)

## Summary

Implement pylint's nan-comparison, part of #970.

## Test Plan

Text fixture was added.
This commit is contained in:
Auguste Lalande 2024-03-20 20:36:17 -04:00 committed by GitHub
parent 4045df4ad4
commit 685de912ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 302 additions and 0 deletions

View file

@ -294,6 +294,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
#[allow(deprecated)]
(Pylint, "R6301") => (RuleGroup::Nursery, rules::pylint::rules::NoSelfUse),
(Pylint, "W0108") => (RuleGroup::Preview, rules::pylint::rules::UnnecessaryLambda),
(Pylint, "W0117") => (RuleGroup::Preview, rules::pylint::rules::NanComparison),
(Pylint, "W0120") => (RuleGroup::Stable, rules::pylint::rules::UselessElseOnLoop),
(Pylint, "W0127") => (RuleGroup::Stable, rules::pylint::rules::SelfAssigningVariable),
(Pylint, "W0128") => (RuleGroup::Preview, rules::pylint::rules::RedeclaredAssignedName),