mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
[refurb] Implement read-whole-file
[FURB101
] (#7682)
## Summary This PR is part of a bigger effort of re-implementing `refurb` rules #1348. It adds support for [FURB101](https://github.com/dosisod/refurb/blob/master/refurb/checks/pathlib/read_text.py) ## Test Plan I included a new test + checked that all other tests pass.
This commit is contained in:
parent
c8464c3a90
commit
bc49492085
8 changed files with 566 additions and 0 deletions
|
@ -921,6 +921,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Flake8Slots, "002") => (RuleGroup::Stable, rules::flake8_slots::rules::NoSlotsInNamedtupleSubclass),
|
||||
|
||||
// refurb
|
||||
(Refurb, "101") => (RuleGroup::Preview, rules::refurb::rules::ReadWholeFile),
|
||||
(Refurb, "105") => (RuleGroup::Preview, rules::refurb::rules::PrintEmptyString),
|
||||
#[allow(deprecated)]
|
||||
(Refurb, "113") => (RuleGroup::Nursery, rules::refurb::rules::RepeatedAppend),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue