target-version = "py38"
line-length = 132
exclude = [
    "fixtures",
    "site",
]
select = [
    "A",
    "ANN",
    "ARG",
    "B",
    "BLE",
    "C",
    "C4",
    "COM",
    "D",
    "DTZ",
    "E",
    "ERA",
    "EXE",
    "F",
    "FBT",
    "G",
    "I",
    "ICN",
    "INP",
    "ISC",
    "N",
    "PGH",
    "PIE",
    "PL",
    "PLC",
    "PLE",
    "PLR",
    "PLW",
    "PT",
    "PYI",
    "Q",
    "RUF",
    "RSE",
    "RET",
    "S",
    "SIM",
    "SLF",
    "T",
    "T10",
    "T20",
    "TCH",
    "TID",
    "TRY",
    "UP",
    "W",
    "YTT",
]
ignore = [
    "A001",  # Variable is shadowing a Python builtin
    "ANN101",  # Missing type annotation for self
    "ANN102",  # Missing type annotation for cls
    "ANN204",  # Missing return type annotation for special method __str__
    "ANN401",  # Dynamically typed expressions (typing.Any) are disallowed
    "ARG005",  # Unused lambda argument
    "C901",  # Too complex
    "D105",  # Missing docstring in magic method
    "D417",  # Missing argument description in the docstring
    "E501",  # Line too long
    "ERA001",  # Commented out code
    "G004",  # Logging statement uses f-string
    "PLR0911",  # Too many return statements
    "PLR0912",  # Too many branches
    "PLR0913",  # Too many arguments to function call
    "PLR0915",  # Too many statements
    "SLF001", # Private member accessed
    "TRY003",  # Avoid specifying long messages outside the exception class
]

[per-file-ignores]
"src/*/cli.py" = [
    "T201",  # Print statement
]
"src/*/git.py" = [
    "S603",  # `subprocess` call: check for execution of untrusted input
    "S607",  # Starting a process with a partial executable path
]
"tests/test_git.py" = [
    "S603",  # `subprocess` call: check for execution of untrusted input
    "S607",  # Starting a process with a partial executable path
]
"src/*/*/nodes/*.py" = [
    "ARG001",  # Unused function argument
    "N812",  # Lowercase `keyword` imported as non-lowercase `NodeKeyword`
]
"src/*/debug.py" = [
    "T201",  # Print statement
]
"scripts/*.py" = [
    "INP001",  # File is part of an implicit namespace package
    "T201",  # Print statement
]
"tests/*.py" = [
    "ARG005",  # Unused lambda argument
    "FBT001",  # Boolean positional arg in function definition
    "PLC1901",  # a == "" can be simplified to not a
    "PLR2004",  # Magic value used in comparison
    "S101",  # Use of assert detected
]

[flake8-quotes]
docstring-quotes = "double"

[flake8-tidy-imports]
ban-relative-imports = "all"

[isort]
known-first-party = ["griffe"]

[pydocstyle]
convention = "google"
