[flake8-use-pathlib] Recommend Path.iterdir() over os.listdir() (PTH208) (#14509)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
InSync 2024-11-27 16:53:13 +07:00 committed by GitHub
parent 14ba469fc0
commit 187974eff4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 138 additions and 4 deletions

View file

@ -908,6 +908,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
(Flake8UsePathlib, "205") => (RuleGroup::Stable, rules::flake8_use_pathlib::rules::OsPathGetctime),
(Flake8UsePathlib, "206") => (RuleGroup::Stable, rules::flake8_use_pathlib::rules::OsSepSplit),
(Flake8UsePathlib, "207") => (RuleGroup::Stable, rules::flake8_use_pathlib::rules::Glob),
(Flake8UsePathlib, "208") => (RuleGroup::Preview, rules::flake8_use_pathlib::violations::OsListdir),
// flake8-logging-format
(Flake8LoggingFormat, "001") => (RuleGroup::Stable, rules::flake8_logging_format::violations::LoggingStringFormat),