pyproject.toml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [tool.ruff]
  2. # Configuración de Ruff para SquidStats
  3. line-length = 88
  4. target-version = "py311"
  5. # Directorios a excluir
  6. exclude = [
  7. ".bzr",
  8. ".direnv",
  9. ".eggs",
  10. ".git",
  11. ".hg",
  12. ".mypy_cache",
  13. ".nox",
  14. ".pants.d",
  15. ".pytype",
  16. ".ruff_cache",
  17. ".svn",
  18. ".tox",
  19. ".venv",
  20. "__pypackages__",
  21. "_build",
  22. "buck-out",
  23. "build",
  24. "dist",
  25. "node_modules",
  26. "venv",
  27. "static",
  28. "templates",
  29. ]
  30. [tool.ruff.lint]
  31. # Seleccionar reglas a aplicar
  32. select = [
  33. "E", # pycodestyle errors
  34. "W", # pycodestyle warnings
  35. "F", # pyflakes
  36. "I", # isort
  37. "B", # flake8-bugbear
  38. "C4", # flake8-comprehensions
  39. "UP", # pyupgrade
  40. ]
  41. # Ignorar reglas específicas
  42. ignore = [
  43. "E501", # line too long (manejado por line-length)
  44. "B008", # Do not perform function calls in argument defaults
  45. "B904", # Within an except clause, raise exceptions with raise ... from err
  46. "C901", # too complex
  47. ]
  48. # Permitir arreglos automáticos
  49. fixable = ["ALL"]
  50. unfixable = []
  51. # Configuración por archivo
  52. [tool.ruff.lint.per-file-ignores]
  53. "__init__.py" = ["F401"] # Ignorar imports no usados en __init__.py
  54. "tests/**" = ["S101"] # Permitir asserts en tests
  55. [tool.ruff.lint.isort]
  56. known-first-party = ["database", "services", "parsers", "utils"]
  57. [tool.ruff.format]
  58. quote-style = "double"
  59. indent-style = "space"
  60. skip-magic-trailing-comma = false
  61. line-ending = "auto"