Skip to content

Commit

Permalink
Merge pull request #218 from acsone/simplify-linters
Browse files Browse the repository at this point in the history
Simplify linters using ruff
  • Loading branch information
sbidoul authored Oct 28, 2023
2 parents 3c7ea20 + 4ab2e12 commit 659c987
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
1 change: 0 additions & 1 deletion .flake8

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: pre-commit/action@v2.0.0
python-version: "3.12"
- uses: pre-commit/action@v3.0.0
1 change: 0 additions & 1 deletion .isort.cfg

This file was deleted.

23 changes: 6 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.4.1
hooks:
- id: prettier
# https://github.com/prettier/prettier/issues/12143
exclude: "}$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-docstring-first
Expand All @@ -25,16 +21,9 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
hooks:
- id: pyupgrade
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: isort
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ pytest-xdist = "*"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

# ruff

[tool.ruff]
fix = true

[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"I", # isort
]

0 comments on commit 659c987

Please sign in to comment.