# pyproject.toml - Type checker configuration
# Copy these sections to your pyproject.toml

# ============================================================
# mypy Configuration
# ============================================================

[tool.mypy]
# Python version to target
python_version = "3.11"

# Enable strict mode (recommended for new projects)
strict = true

# Additional strictness
warn_return_any = true
warn_unused_ignores = true
warn_unreachable = true

# Error reporting
show_error_codes = true
show_error_context = true
show_column_numbers = true
pretty = true

# Paths
files = ["src", "tests"]
exclude = [
    "migrations/",
    "venv/",
    ".venv/",
    "__pycache__/",
    "build/",
    "dist/",
]

# Plugin support (uncomment as needed)
# plugins = [
#     "pydantic.mypy",
#     "sqlalchemy.ext.mypy.plugin",
# ]

# ============================================================
# Per-module overrides
# ============================================================

# Relax strictness for tests
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_untyped_calls = false

# Ignore missing stubs for common libraries
[[tool.mypy.overrides]]
module = [
    "requests.*",
    "boto3.*",
    "botocore.*",
    "celery.*",
    "redis.*",
]
ignore_missing_imports = true

# Legacy code - gradually add types
# [[tool.mypy.overrides]]
# module = "legacy.*"
# ignore_errors = true


# ============================================================
# pyright Configuration
# ============================================================

[tool.pyright]
# Python version
pythonVersion = "3.11"

# Paths
include = ["src"]
exclude = [
    "**/node_modules",
    "**/__pycache__",
    "venv",
    ".venv",
    "build",
    "dist",
]

# Type checking mode: off, basic, standard, strict
typeCheckingMode = "strict"

# Report settings (strict mode enables all by default)
reportMissingTypeStubs = false
reportUnusedImport = "warning"
reportUnusedVariable = "warning"
reportUnusedFunction = "warning"

# Useful additional checks
reportUninitializedInstanceVariable = true
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true


# ============================================================
# Recommended dev dependencies
# ============================================================

# [project.optional-dependencies]
# dev = [
#     "mypy>=1.8.0",
#     "pyright>=1.1.350",
#     # Common type stubs
#     "types-requests",
#     "types-redis",
#     "types-PyYAML",
#     "types-python-dateutil",
# ]
