[tool.pytest.ini_options]
addopts = [
    '--junitxml=.junit_report.xml',
]
junit_family = 'xunit2'
asyncio_mode = 'auto'
filterwarnings = [
    'error',
    'ignore:The SelectBase.c and SelectBase.columns attributes are deprecated.*:DeprecationWarning',
    'ignore:pkg_resources is deprecated as an API.*:DeprecationWarning',
    'ignore:Deprecated call to `pkg_resources.declare_namespace(.*)`.*:DeprecationWarning',
    'ignore:.*:pytest.PytestDeprecationWarning',
    'ignore:.*pytest-asyncio detected an unclosed event loop.*:DeprecationWarning',
    'ignore:.*The event_loop fixture provided by pytest-asyncio has been redefined.*:DeprecationWarning',
]

[tool.mypy]
    junit_xml = '.junit_report.xml'
    follow_imports = 'silent'
    disallow_any_explicit = false
    disallow_any_generics = true
    check_untyped_defs = true
    disallow_untyped_defs = true
    disallow_incomplete_defs = true
    disallow_untyped_decorators = false
    warn_unused_configs = true
    disallow_subclassing_any = false
    disallow_untyped_calls = false
    no_implicit_optional = true
    warn_redundant_casts = true
    warn_unused_ignores = true
    warn_return_any = true
    no_implicit_reexport = true
    show_error_codes = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true

# Per-module options:
[[tool.mypy.overrides]]
module = ['aioresponses.*']
disallow_any_explicit = false
disallow_any_generics = false

[[tool.mypy.overrides]]
module = ['fastapi_sso.*']
ignore_missing_imports = true

[tool.pylint.'MESSAGES CONTROL']
disable = [
    'dangerous-default-value',
    'duplicate-code',
    'import-outside-toplevel',
    'invalid-name',
    'logging-fstring-interpolation',
    'missing-docstring',
    'no-name-in-module', # Gives false positives.
    'protected-access',
    'too-few-public-methods',
    'too-many-arguments',
    'too-many-locals',
    'too-many-nested-blocks',
    'unspecified-encoding',
    'unused-argument',  # Gives false positives.
    'wrong-import-position',
    'fixme',
    'broad-except',
    'consider-iterating-dictionary',
]

[tool.bandit]
skips = [
    'B101',
    'B106',
    'B108'
]

[tool.ruff]
line-length = 100
respect-gitignore = false
show-fixes = true
output-format = "full"
target-version = "py311"
exclude = [".mypy_cache", ".pytest_cache", "__pycache__"]

[tool.ruff.lint]
select = [
    "E",
    "EXE",
#    "ERA", TODO
    "F",
    "FA",
    "FIX",
    "I",
    "ISC",
    "PGH",
    "PIE",
    "PLE",
    "PLW",
    "RUF100",
    "T20",
    "TCH",
    "TD",
    "TID",
    "UP",
    "W",
]
ignore = ["FIX002", "TD002", "TD003", "TCH001", "TCH002", "TCH003", "ISC001"]

[tool.vulture]
min_confidence = 0
paths = ["."]
ignore_decorators = ["@pytest.*", "@*router*", "@app.*", "@*validator*"]
ignore_names = [
    "todo*",
    "RestartableUvicornWorker",
    "_generate_next_value_",
    "downgrade",
    "upgrade"
]
sort_by_size = true
