# Project configuiration options for Python tools.
[tool.mypy] # https://mypy.readthedocs.io/en/stable/config_file.html
python_version = "3.11"
files = ["."]
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = false     # Some calls from NumPy are untyped.
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
no_implicit_reexport = true
strict_equality = true

[tool.ruff] # https://docs.astral.sh/ruff/rules/
line-length = 120
target-version = "py311"

[tool.ruff.lint]
select = [
    "C90", # mccabe
    "D",   # pydocstyle
    "E",   # pycodestyle
    "W",   # pycodestyle
    "F",   # Pyflakes
    "I",   # isort
    "UP",  # pyupgrade
    "YTT", # flake8-2020
    "ANN", # flake8-annotations
    "S",   # flake8-bandit
    "B",   # flake8-bugbear
    "C4",  # flake8-comprehensions
    "DTZ", # flake8-datetimez
    "EM",  # flake8-errmsg
    "EXE", # flake8-executable
    "FA",  # flake8-future-annotations
    "RET", # flake8-return
    "ICN", # flake8-import-conventions
    "PIE", # flake8-pie
    "PT",  # flake8-pytest-style
    "SIM", # flake8-simplify
    "PTH", # flake8-use-pathlib
    "PL",  # Pylint
    "TRY", # tryceratops
    "RUF", # NumPy-specific rules
    "G",   # flake8-logging-format
]
ignore = [
    "E501",    # line-too-long
    "S101",    # assert
    "ANN101",  # missing-type-self
    "ANN102",  # missing-type-cls
    "S311",    # suspicious-non-cryptographic-random-usage
    "PLR0913", # too-many-arguments
]

[tool.ruff.lint.pydocstyle] # https://docs.astral.sh/ruff/settings/#lintpydocstyle
convention = "google"
