refactor: consolidate linting tools into Ruff
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
+22
-85
@@ -104,33 +104,30 @@ upload_to_vcs_release = true
|
||||
upload_to_pypi = false
|
||||
upload_to_repository = false
|
||||
|
||||
# Black configuration
|
||||
[tool.black]
|
||||
# Ruff configuration
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = ['py311']
|
||||
include = '\.pyi?$'
|
||||
extend-exclude = '''
|
||||
/(
|
||||
# directories
|
||||
\.eggs
|
||||
| \.git
|
||||
| \.hg
|
||||
| \.mypy_cache
|
||||
| \.tox
|
||||
| \.venv
|
||||
| build
|
||||
| dist
|
||||
| migrations
|
||||
)/
|
||||
'''
|
||||
target-version = "py311"
|
||||
|
||||
# isort configuration
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
line_length = 120
|
||||
skip_gitignore = true
|
||||
known_first_party = ["app"]
|
||||
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
|
||||
[tool.ruff.lint]
|
||||
# Enable Pyflakes (`F`), pycodestyle (`E`, `W`), isort (`I`), bandit (`S`), flake8-bugbear (`B`), and pylint (`PL`)
|
||||
select = ["E", "F", "W", "I", "S", "B", "PL"]
|
||||
ignore = [
|
||||
"E501", # Line too long (handled by formatter)
|
||||
"S108", # Hardcoded temp file (common pattern)
|
||||
"S105", # Hardcoded password string (false positives with 'password' variable names)
|
||||
"S106", # Hardcoded password func arg (false positives)
|
||||
"PLC0415", # Import outside top-level (common in FastAPI/Celery)
|
||||
"PLR0913", # Too many arguments
|
||||
"PLR0912", # Too many branches
|
||||
"PLR0915", # Too many statements
|
||||
"PLR0911", # Too many return statements
|
||||
"PLR2004", # Magic value comparison
|
||||
"PLW0603", # Global statement
|
||||
]
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/*" = ["S101", "S110", "B017"] # Allow assert, try-except-pass, assert-raises-exception in tests
|
||||
|
||||
# pytest configuration
|
||||
[tool.pytest.ini_options]
|
||||
@@ -195,66 +192,6 @@ disable_error_code = [
|
||||
"call-arg", # Dynamic call signatures in framework code
|
||||
]
|
||||
|
||||
# pylint configuration
|
||||
[tool.pylint.format]
|
||||
max-line-length = 120
|
||||
|
||||
[tool.pylint."messages control"]
|
||||
disable = [
|
||||
"C0111", # missing-docstring (already documented functions use docstrings selectively)
|
||||
"C0103", # invalid-name (project uses domain-specific naming conventions)
|
||||
"C0114", # missing-module-docstring
|
||||
"C0115", # missing-class-docstring
|
||||
"C0116", # missing-function-docstring
|
||||
"C0415", # import-outside-toplevel (common pattern in FastAPI/Celery)
|
||||
"C0200", # consider-using-enumerate
|
||||
"C0201", # consider-iterating-dictionary
|
||||
"C0206", # consider-using-dict-items
|
||||
"C0207", # use-maxsplit-arg
|
||||
"C0123", # unidiomatic-typecheck
|
||||
"C0302", # too-many-lines
|
||||
"R0801", # duplicate-code (intentional patterns across storage providers)
|
||||
"R0401", # cyclic-import (FastAPI app structure with lazy imports)
|
||||
"R0903", # too-few-public-methods
|
||||
"R0911", # too-many-return-statements
|
||||
"R0912", # too-many-branches
|
||||
"R0913", # too-many-arguments
|
||||
"R0914", # too-many-locals
|
||||
"R0915", # too-many-statements
|
||||
"R0916", # too-many-boolean-expressions
|
||||
"R0917", # too-many-positional-arguments
|
||||
"R1702", # too-many-nested-blocks
|
||||
"R1705", # no-else-return
|
||||
"R1710", # inconsistent-return-statements
|
||||
"R1718", # consider-using-set-comprehension
|
||||
"R1720", # no-else-raise
|
||||
"R1723", # no-else-break
|
||||
"R1732", # consider-using-with
|
||||
"W0105", # pointless-string-statement
|
||||
"W0212", # protected-access
|
||||
"W0223", # abstract-method
|
||||
"W0404", # reimported
|
||||
"W0511", # fixme (TODO comments are acceptable)
|
||||
"W0603", # global-statement
|
||||
"W0611", # unused-import (managed by flake8/isort)
|
||||
"W0613", # unused-argument (common with framework callbacks)
|
||||
"W0621", # redefined-outer-name
|
||||
"W0641", # possibly-unused-variable
|
||||
"W0707", # raise-missing-from
|
||||
"W0718", # broad-exception-caught (intentional in error handlers)
|
||||
"W0719", # broad-exception-raised
|
||||
"W1203", # logging-fstring-interpolation (project uses f-strings consistently)
|
||||
"W1510", # subprocess-run-check
|
||||
"W1514", # unspecified-encoding
|
||||
"W0612", # unused-variable
|
||||
"E0213", # no-self-argument (Pydantic validators use cls)
|
||||
"E0611", # no-name-in-module (false positives with package imports)
|
||||
"E1101", # no-member (false positives with dynamic API clients)
|
||||
"E1102", # not-callable (false positives with SQLAlchemy func.now())
|
||||
"E1133", # not-an-iterable (false positives with Pydantic fields)
|
||||
"E1135", # unsupported-membership-test (false positives with Pydantic fields)
|
||||
]
|
||||
|
||||
# Coverage configuration
|
||||
[tool.coverage.run]
|
||||
source = ["app"]
|
||||
|
||||
Reference in New Issue
Block a user