pyproject.toml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. "UP017", # Use `datetime.UTC` alias (not available in Python 3.10)
  48. ]
  49. # Permitir arreglos automáticos
  50. fixable = ["ALL"]
  51. unfixable = []
  52. # Configuración por archivo
  53. [tool.ruff.lint.per-file-ignores]
  54. "__init__.py" = ["F401"] # Ignorar imports no usados en __init__.py
  55. "tests/**" = ["S101"] # Permitir asserts en tests
  56. [tool.ruff.lint.isort]
  57. known-first-party = ["database", "services", "parsers", "utils"]
  58. [tool.ruff.format]
  59. quote-style = "double"
  60. indent-style = "space"
  61. skip-magic-trailing-comma = false
  62. line-ending = "auto"
  63. [tool.pytest.ini_options]
  64. asyncio_mode = "auto"