Fixes #21407: Enable I (isort) and stabilize import ordering (#21458)
CI / build (20.x, 3.12) (push) Failing after 10s
CI / build (20.x, 3.13) (push) Failing after 9s
CI / build (20.x, 3.14) (push) Failing after 9s
CodeQL / Analyze (actions) (push) Failing after 37s
CodeQL / Analyze (javascript-typescript) (push) Failing after 48s
CodeQL / Analyze (python) (push) Failing after 49s

- Adopt Ruff `I` (isort) rules for consistent import sorting
- Add two `# isort: split` boundaries to keep required imports pinned
  in `__init__.py` modules
This commit is contained in:
Martin Hauser
2026-02-18 17:41:51 +01:00
committed by GitHub
parent 7300104cea
commit 945e7ade0a
438 changed files with 1067 additions and 527 deletions
+18
View File
@@ -36,6 +36,7 @@ extend-select = [
"E3", # pycodestyle errors: blank lines / spacing around definitions
"E501", # pycodestyle: line too long (enforced with `line-length` above)
"W", # pycodestyle warnings (various style warnings, often whitespace/newlines)
"I", # import sorting (isort-equivalent)
]
ignore = [
"F403", # pyflakes: `from ... import *` used; unable to detect undefined names
@@ -44,6 +45,23 @@ ignore = [
]
preview = true
[lint.isort]
known-first-party = [
"account",
"circuits",
"core",
"dcim",
"extras",
"ipam",
"netbox",
"tenancy",
"users",
"utilities",
"virtualization",
"vpn",
"wireless",
]
[lint.per-file-ignores]
"template_code.py" = ["E501"]