mirror of https://github.com/peter4431/rq.git
Update linting configuration (#1915)
* Update linting configuration This removes flake8 in favor of ruff, which also provides isort support, and updates all files to be black, isort, and ruff compliant. This also adds black and ruff checks to the tox and Github linting workflow. * Tweak the code coverage config and callsmain
parent
bbfeb8c8ed
commit
ea063edf0a
@ -1,16 +1,13 @@
|
||||
[run]
|
||||
source = rq
|
||||
omit =
|
||||
rq/scripts/*
|
||||
rq/compat/*
|
||||
rq/contrib/legacy.py
|
||||
rq/dummy.py
|
||||
rq/local.py
|
||||
rq/tests/*
|
||||
tests/*
|
||||
|
||||
[report]
|
||||
exclude_lines =
|
||||
if __name__ == .__main__.:
|
||||
if TYPE_CHECKING:
|
||||
pragma: no cover
|
||||
if __name__ == .__main__.:
|
||||
|
@ -0,0 +1,9 @@
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: "v0.0.267"
|
||||
hooks:
|
||||
- id: ruff
|
@ -1,2 +1,3 @@
|
||||
ignore:
|
||||
- setup.py
|
||||
- "*/tests/*"
|
||||
|
@ -1,4 +1,20 @@
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
target-version = ['py36']
|
||||
target-version = ['py38']
|
||||
skip-string-normalization = true
|
||||
|
||||
[tool.ruff]
|
||||
# Set what ruff should check for.
|
||||
# See https://beta.ruff.rs/docs/rules/ for a list of rules.
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"F", # pyflakes errors
|
||||
"I", # import sorting
|
||||
"W", # pycodestyle warnings
|
||||
]
|
||||
line-length = 120 # To match black.
|
||||
target-version = 'py38'
|
||||
|
||||
[tool.ruff.isort]
|
||||
known-first-party = ["rq"]
|
||||
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
|
||||
|
Loading…
Reference in New Issue