ruff.toml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Ruff configuration
  2. ####################
  3. exclude = [
  4. ".eggs",
  5. ".git",
  6. ".pyenv",
  7. ".pytest_cache",
  8. ".ruff_cache",
  9. ".venv",
  10. ".vscode",
  11. "__pypackages__",
  12. "_build",
  13. "build",
  14. "dist",
  15. "netbox/project-static/**",
  16. "node_modules",
  17. "site-packages",
  18. "venv",
  19. ]
  20. # Enforce line length and indent-width
  21. line-length = 120
  22. indent-width = 4
  23. # Ignores anything in .gitignore
  24. respect-gitignore = true
  25. # Always generate Python 3.12-compatible code
  26. target-version = "py312"
  27. [lint]
  28. extend-select = [
  29. "E1", # pycodestyle errors: indentation-related (e.g., unexpected/missing indent)
  30. "E2", # pycodestyle errors: whitespace-related (e.g., missing whitespace, extra spaces)
  31. "E3", # pycodestyle errors: blank lines / spacing around definitions
  32. "E501", # pycodestyle: line too long (enforced with `line-length` above)
  33. "W", # pycodestyle warnings (various style warnings, often whitespace/newlines)
  34. "I", # import sorting (isort-equivalent)
  35. ]
  36. ignore = [
  37. "F403", # pyflakes: `from ... import *` used; unable to detect undefined names
  38. "F405", # pyflakes: name may be undefined or defined from star imports
  39. "UP032", # pyupgrade: prefer f-strings over `str.format(...)`
  40. ]
  41. preview = true
  42. [lint.isort]
  43. known-first-party = [
  44. "account",
  45. "circuits",
  46. "core",
  47. "dcim",
  48. "extras",
  49. "ipam",
  50. "netbox",
  51. "tenancy",
  52. "users",
  53. "utilities",
  54. "virtualization",
  55. "vpn",
  56. "wireless",
  57. ]
  58. [lint.per-file-ignores]
  59. "template_code.py" = ["E501"]
  60. [format]
  61. # Use single quotes for strings.
  62. quote-style = "single"
  63. # Indent with spaces, rather than tabs.
  64. indent-style = "space"
  65. # Enforce UNIX line ending
  66. line-ending = "lf"