[project]
name = "dmarq"
version = "1.4.0"
description = "A modern, privacy-conscious DMARC monitoring and analysis platform"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.10"

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
version_variables = ["backend/app/__init__.py:__version__"]
commit_message = "chore(release): v{version}"
tag_format = "v{version}"
build_command = "python3 scripts/sync_version.py"
upload_to_pypi = false

[tool.semantic_release.changelog]
changelog_file = "CHANGELOG.md"

[tool.semantic_release.branches.main]
match = "main"

[tool.black]
line-length = 100
target-version = ['py310']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | venv
  | _build
  | buck-out
  | build
  | dist
)/
'''

[tool.isort]
profile = "black"
line_length = 100
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
known_first_party = ["app"]
skip = ["venv", ".venv", "migrations"]

[tool.pylint.main]
# Run from repo root: pylint backend/app
max-line-length = 100

[tool.pylint."messages control"]
disable = [
    "C0111",  # missing-docstring
    "C0103",  # invalid-name  (e.g. SessionLocal, TestingSessionLocal)
    "R0903",  # too-few-public-methods
    "R0913",  # too-many-arguments
    "W0212",  # protected-access
]

[tool.pylint.basic]
good-names = ["i", "j", "k", "ex", "_", "id", "db"]

[tool.pytest.ini_options]
testpaths = ["backend/app/tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
    "--verbose",
    "--strict-markers",
    "--tb=short",
]
markers = [
    "slow: marks tests as slow",
    "integration: marks tests as integration tests",
    "security: marks tests as security-related",
]

[tool.coverage.run]
source = ["backend/app"]
omit = [
    "*/tests/*",
    "*/venv/*",
    "*/__pycache__/*",
    "*/migrations/*",
]

[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false

[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
check_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
strict_optional = true
