# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
    ".vs",
    "CMakeFiles",
    "x64",
    "CVS",
]

# Same as Black.
line-length = 120

# Assume Python 3.11
target-version = "py312"

[lint]

per-file-ignores = { }

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E", "F", "B", "UP", "ANN", "A", "C4", "DTZ", "NPY", "PL", "FURB", "RUF",
    #"D"
]

# Never enforce `E501` (line length violations).
ignore = ["E501", "F401", "E401", "B904", "E402", "C901",
    "PLR0912", "PLR0915", "PLR0913", "ANN201", "ANN201", "ANN204", "ANN001", "ANN002",
    "D102", "D103", "D205", "D212", "PLR2004", "PLW2901", "DTZ005", "DTZ006", "UP015",
    "RUF012", "DTZ001",
]

# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B", "F401"]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL", "F541"]

[lint.pydocstyle]
convention = "google"

[format]
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
docstring-code-format = false