Skip to content

Commit

Permalink
build: add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Mause committed Apr 16, 2024
1 parent ebab0cb commit 4a3392a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
40 changes: 8 additions & 32 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,6 @@ repos:
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args:
- --float-to-top
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- --py37-plus
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
Expand All @@ -52,10 +26,12 @@ repos:
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
- repo: https://github.com/PyCQA/flake8
rev: '7.0.0' # pick a git hash / tag to point to
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.3.0'
hooks:
- id: flake8
args:
- --jobs=1
- --extend-ignore=W503,E203,E501
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- id: ruff-format
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ plugins = ['sqlalchemy.ext.mypy.plugin']
[tool.isort]
profile = "black"

[tool.ruff]
target-version = "py37"

[tool.ruff.lint]
select = ["E", "I"]
ignore = ['E203', 'E501']

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 4a3392a

Please sign in to comment.