mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-20 07:51:35 +02:00
chore(ruff): Enable RET rules and add explicit fallbacks
Adopt Ruff `RET` to improve return-flow consistency across the codebase. Simplify control flow by removing redundant `else` blocks after `return`, and add explicit `return None` (or equivalent) fallbacks where appropriate to preserve existing behavior. Fixes #21411
This commit is contained in:
committed by
Jeremy Stretch
parent
b22e490847
commit
ef52ac4203
@@ -37,10 +37,12 @@ extend-select = [
|
||||
"E501", # pycodestyle: line too long (enforced with `line-length` above)
|
||||
"W", # pycodestyle warnings (various style warnings, often whitespace/newlines)
|
||||
"I", # import sorting (isort-equivalent)
|
||||
"RET", # return semantics (flake8-return family)
|
||||
]
|
||||
ignore = [
|
||||
"F403", # pyflakes: `from ... import *` used; unable to detect undefined names
|
||||
"F405", # pyflakes: name may be undefined or defined from star imports
|
||||
"RET504", # return: unnecessary assignment before `return` (e.g., `x = expr; return x` -> `return expr`)
|
||||
"UP032", # pyupgrade: prefer f-strings over `str.format(...)`
|
||||
]
|
||||
preview = true
|
||||
|
||||
Reference in New Issue
Block a user