[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.ruff]
line-length = 100
target-version = "py38"
# Treat "_" as a builtin (same as flake8 config)
builtins = ["_"]
# Exclude external directory (same as black/flake8/etc)
exclude = ["rednotebook/external/*"]

[tool.ruff.lint]
# Enable the same rules that were previously handled by flake8, isort, and pyupgrade.
select = [
    "E",   # pycodestyle errors
    "W",   # pycodestyle warnings
    "F",   # pyflakes
    "I",   # isort
    "UP",  # pyupgrade
]
# Ignore the same rules that were ignored in flake8 config
ignore = [
    "E203",  # whitespace before ':' (not compliant with PEP 8)
    "E402",  # module level import not at top of file
    "F821",  # undefined name "_"
]

[tool.ruff.lint.per-file-ignores]
# Allow certain files to have different rules.
"rednotebook/journal.py" = ["I001"]  # Skip isort for this file

[tool.ruff.lint.isort]
lines-after-imports = 2

[tool.vulture]
min_confidence = 0
paths = ["rednotebook/", "dev/whitelist.py"]
exclude = ["external/"]
