Skip to content

Commit a39336b

Browse files
authored
Ruff: enable all pyflakes and perf rules (#4556)
1 parent e5f16a2 commit a39336b

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

ruff.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@ exclude = [
77
[lint]
88
extend-select = [
99
"C901",
10-
"PERF401",
1110
"W",
1211

1312
# local
1413
"ANN2", # missing-return-type-*
14+
"F", # Pyflakes
1515
"F404", # late-future-import
1616
"FA", # flake8-future-annotations
1717
"I", # isort
18+
"PERF", # Perflint
1819
"PYI", # flake8-pyi
1920
"TRY", # tryceratops
2021
"UP", # pyupgrade
2122
"YTT", # flake8-2020
2223
]
2324
ignore = [
25+
"PERF203", # try-except-in-loop, micro-optimisation with many false-positive. Worth checking but don't block CI
2426
"TRY003", # raise-vanilla-args, avoid multitude of exception classes
2527
"TRY301", # raise-within-try, it's handy
2628
"UP015", # redundant-open-modes, explicit is preferred

setuptools/command/easy_install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,7 @@ def get_args(cls, dist, header=None):
21872187
spec = str(dist.as_requirement())
21882188
for type_ in 'console', 'gui':
21892189
group = type_ + '_scripts'
2190-
for name, ep in dist.get_entry_map(group).items():
2190+
for name in dist.get_entry_map(group).keys():
21912191
cls._ensure_safe_name(name)
21922192
script_text = cls.template % locals()
21932193
args = cls._get_script_args(type_, name, header, script_text)

setuptools/tests/test_manifest.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,8 @@ def test_process_template_line_invalid(self):
485485
'prune',
486486
'blarg',
487487
):
488-
try:
488+
with pytest.raises(DistutilsTemplateError):
489489
file_list.process_template_line(action)
490-
except DistutilsTemplateError:
491-
pass
492-
except Exception:
493-
assert False, "Incorrect error thrown"
494-
else:
495-
assert False, "Should have thrown an error"
496490

497491
def test_include(self, caplog):
498492
caplog.set_level(logging.DEBUG)

0 commit comments

Comments
 (0)