pyproject.toml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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",
  34. "W",
  35. "F",
  36. "I",
  37. "B",
  38. "C4",
  39. "UP",
  40. "S",
  41. ]
  42. # Ignorar reglas específicas
  43. ignore = [
  44. "E501", # line too long (manejado por line-length)
  45. "B008", # Do not perform function calls in argument defaults
  46. "B904", # Within an except clause, raise exceptions with raise ... from err
  47. "C901", # too complex
  48. "UP017", # Use `datetime.UTC` alias (not available in Python 3.10)
  49. ]
  50. # Permitir arreglos automáticos
  51. fixable = ["ALL"]
  52. unfixable = []
  53. # Configuración por archivo
  54. [tool.ruff.lint.per-file-ignores]
  55. "__init__.py" = ["F401"] # Ignorar imports no usados en __init__.py
  56. "tests/**" = ["S101"] # Permitir asserts en tests
  57. [tool.ruff.lint.isort]
  58. known-first-party = ["database", "services", "parsers", "utils"]
  59. [tool.ruff.format]
  60. quote-style = "double"
  61. indent-style = "space"
  62. skip-magic-trailing-comma = false
  63. line-ending = "auto"
  64. [tool.pytest.ini_options]
  65. asyncio_mode = "auto"