-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
PLR0912(too-many-branches) does not count branches inside with: blocks. With pylint the following is detected, while ruff does not detect this rule violation
from contextlib import suppress
def capital(country):
with suppress(Exception):
if country == "Australia":
return "Canberra"
elif country == "Brazil":
return "Brasilia"
elif country == "Canada":
return "Ottawa"
elif country == "England":
return "London"
elif country == "France":
return "Paris"
elif country == "Germany":
return "Berlin"
elif country == "Poland":
return "Warsaw"
elif country == "Romania":
return "Bucharest"
elif country == "Spain":
return "Madrid"
elif country == "Thailand":
return "Bangkok"
elif country == "Turkey":
return "Ankara"
elif country == "Undefined":
return None
else:
return "Some"Ruff version: 0.4.3
command: ruff check test.py --select PLR0912 --isolated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers