# Configuración centralizada para herramientas de desarrollo Python [tool.black] # Black - Formateador de código opinionado line-length = 120 target-version = ['py311'] include = '\.pyi?$' extend-exclude = ''' /( # Directorios a excluir \.git | \.venv | venv | env | __pycache__ | migrations | staticfiles | media | node_modules | dist | build )/ ''' [tool.isort] # isort - Ordenador de imports profile = "black" line_length = 120 multi_line_output = 3 include_trailing_comma = true force_grid_wrap = 0 use_parentheses = true ensure_newline_before_comments = true skip_glob = [ "*/migrations/*", "*/venv/*", "*/env/*", ".venv/*", "staticfiles/*", "media/*" ] known_django = "django" known_first_party = ["authentication", "attendance", "events", "mac_attendance"] sections = ["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] [tool.pytest.ini_options] # pytest - Framework de testing DJANGO_SETTINGS_MODULE = "mac_attendance.settings" python_files = ["tests.py", "test_*.py", "*_tests.py"] addopts = [ "--verbose", "--strict-markers", "--tb=short", "--cov=.", "--cov-report=html", "--cov-report=term-missing", ] testpaths = ["tests"] markers = [ "slow: marks tests as slow (deselect with '-m \"not slow\"')", "integration: marks tests as integration tests", "unit: marks tests as unit tests", ] [tool.coverage.run] # Coverage - Cobertura de código source = ["."] omit = [ "*/migrations/*", "*/tests/*", "*/test_*.py", "*/__pycache__/*", "*/venv/*", "*/env/*", ".venv/*", "manage.py", "*/wsgi.py", "*/asgi.py", ] [tool.coverage.report] precision = 2 show_missing = true skip_covered = false exclude_lines = [ "pragma: no cover", "def __repr__", "raise AssertionError", "raise NotImplementedError", "if __name__ == .__main__.:", "if TYPE_CHECKING:", "class .*\\bProtocol\\):", "@(abc\\.)?abstractmethod", ] [tool.mypy] # mypy - Type checker python_version = "3.11" check_untyped_defs = true ignore_missing_imports = true warn_unused_ignores = true warn_redundant_casts = true warn_unused_configs = true plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"] [[tool.mypy.overrides]] module = "*.migrations.*" ignore_errors = true [tool.django-stubs] django_settings_module = "mac_attendance.settings" [tool.pylint.main] # pylint - Analizador estático load-plugins = ["pylint_django"] django-settings-module = "mac_attendance.settings" [tool.pylint.format] max-line-length = 120 [tool.pylint.messages_control] disable = [ "C0111", # missing-docstring "C0103", # invalid-name "R0903", # too-few-public-methods "R0913", # too-many-arguments ] [tool.pylint.design] max-attributes = 10 max-args = 7 [tool.bandit] # bandit - Verificador de seguridad exclude_dirs = [ "/tests/", "/migrations/", "/venv/", "/.venv/", ] skips = ["B101", "B601"] [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta"