datahub/metadata-ingestion/pyproject.toml
2025-04-23 15:55:46 +02:00

61 lines
1.9 KiB
TOML

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools >= 71.1", "wheel"]
[tool.ruff.lint.isort]
section-order = ["future", "patch", "standard-library", "third-party", "first-party", "local-folder"]
sections = { "patch" = ["datahub.utilities._markupsafe_compat", "datahub.sql_parsing._sqlglot_patch"] }
combine-as-imports = true
[tool.ruff]
target-version = "py38"
# Same as Black.
line-length = 88
# Exclude directories matching these patterns.
exclude = [
".git",
"src/datahub/metadata",
"venv",
".tox",
"__pycache__",
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C90", # mccabe complexity
"E", # pycodestyle errors
"F", # pyflakes
"G010", # logging.warn -> logging.warning
"I", # isort
"TID", # flake8-tidy-imports
"RUF100", # unused-noqa
"SIM", # flake8-simplify
]
extend-ignore = [
"E501", # Handled by formatter
"E111", # Handled by formatter
"E114", # Handled by formatter
"E117", # Handled by formatter
"B019", # Allow usages of functools.lru_cache
"B008", # Allow function call in argument defaults
"RUF012", # mutable-class-default; incompatible with pydantic
"RUF015", # unnecessary-iterable-allocation-for-first-element
# Can be enabled later if someone wants to fix existing cases or an auto-fix becomes available
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM103", # Return the condition directly
"SIM105", # Use `contextlib.suppress(...)` instead of `try`-`except`-`pass`
"SIM115", # Use a context manager for opening files
"SIM116", # Use a dictionary instead of consecutive `if` statements
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]