mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Use ruff for code checking and linting
`isort` is failing in pre-commit.ci right now, so this might be good timing. See: https://whynothugo.nl/journal/2023/01/20/notes-on-ruff/
This commit is contained in:
parent
8c6c0be15a
commit
d646357cd3
4 changed files with 20 additions and 32 deletions
|
|
@ -8,26 +8,10 @@ repos:
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
- repo: https://github.com/PyCQA/flake8
|
|
||||||
rev: "6.0.0"
|
|
||||||
hooks:
|
|
||||||
- id: flake8
|
|
||||||
additional_dependencies:
|
|
||||||
- flake8-bugbear
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: "22.10.0"
|
rev: "22.10.0"
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/pycqa/isort
|
|
||||||
rev: 5.10.1
|
|
||||||
hooks:
|
|
||||||
- id: isort
|
|
||||||
name: isort (python)
|
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
|
||||||
rev: v3.3.0
|
|
||||||
hooks:
|
|
||||||
- id: pyupgrade
|
|
||||||
args: [--py37-plus]
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: "v0.991"
|
rev: "v0.991"
|
||||||
hooks:
|
hooks:
|
||||||
|
|
@ -38,3 +22,7 @@ repos:
|
||||||
- types-docutils
|
- types-docutils
|
||||||
- types-requests
|
- types-requests
|
||||||
- types-atomicwrites
|
- types-atomicwrites
|
||||||
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
|
rev: 'v0.0.237'
|
||||||
|
hooks:
|
||||||
|
- id: ruff
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ virtualenv_ and run this inside of it::
|
||||||
|
|
||||||
# Install development dependencies, including:
|
# Install development dependencies, including:
|
||||||
# - vdirsyncer from the repo into the virtualenv
|
# - vdirsyncer from the repo into the virtualenv
|
||||||
# - stylecheckers (flake8) and code formatters (autopep8)
|
# - stylecheckers (ruff) and code formatters (black)
|
||||||
make install-dev
|
make install-dev
|
||||||
|
|
||||||
# Install git commit hook for some extra linting and checking
|
# Install git commit hook for some extra linting and checking
|
||||||
|
|
|
||||||
15
pyproject.toml
Normal file
15
pyproject.toml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[tool.ruff]
|
||||||
|
select = [
|
||||||
|
"E",
|
||||||
|
"F",
|
||||||
|
"W",
|
||||||
|
"B0",
|
||||||
|
"I",
|
||||||
|
"UP",
|
||||||
|
"C4",
|
||||||
|
# "TID",
|
||||||
|
]
|
||||||
|
target-version = "py37"
|
||||||
|
|
||||||
|
[tool.ruff.isort]
|
||||||
|
force-single-line = true
|
||||||
15
setup.cfg
15
setup.cfg
|
|
@ -8,21 +8,6 @@ addopts =
|
||||||
--color=yes
|
--color=yes
|
||||||
# filterwarnings=error
|
# filterwarnings=error
|
||||||
|
|
||||||
[flake8]
|
|
||||||
application-import-names = tests,vdirsyncer
|
|
||||||
extend-ignore =
|
|
||||||
# Black-incompatible colon spacing.
|
|
||||||
E203,
|
|
||||||
# Line jump before binary operator.
|
|
||||||
W503,
|
|
||||||
I100,
|
|
||||||
I202
|
|
||||||
max-line-length = 88
|
|
||||||
exclude = .eggs,build
|
|
||||||
|
|
||||||
[isort]
|
|
||||||
force_single_line=true
|
|
||||||
|
|
||||||
[mypy]
|
[mypy]
|
||||||
ignore_missing_imports = True
|
ignore_missing_imports = True
|
||||||
# See https://github.com/python/mypy/issues/7511:
|
# See https://github.com/python/mypy/issues/7511:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue