ruff.toml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. ]
  35. ignore = [
  36. "F403", # pyflakes: `from ... import *` used; unable to detect undefined names
  37. "F405", # pyflakes: name may be undefined or defined from star imports
  38. "UP032", # pyupgrade: prefer f-strings over `str.format(...)`
  39. ]
  40. preview = true
  41. [lint.per-file-ignores]
  42. "template_code.py" = ["E501"]
  43. [format]
  44. # Use single quotes for strings.
  45. quote-style = "single"
  46. # Indent with spaces, rather than tabs.
  47. indent-style = "space"
  48. # Enforce UNIX line ending
  49. line-ending = "lf"