Skip to content

Commit

Permalink
Replace Flake8 with Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Nov 7, 2023
1 parent cf849f1 commit 110cb34
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

28 changes: 5 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,15 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: pyupgrade
args: [--py38-plus]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [--add-import=from __future__ import annotations]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
[flake8-2020, flake8-errmsg, flake8-implicit-str-concat, flake8-logging]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -47,7 +29,7 @@ repos:
args: [--strict, --pretty, --show-error-codes]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.2.0
rev: 1.4.1
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
Expand Down
27 changes: 25 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,28 @@ version.source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.isort]
profile = "black"
[tool.ruff]
target-version = "py38"
line-length = 88
select = [
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes errors
"I", # isort
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"RUF100", # unused noqa (yesqa)
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
# "LOG", # TODO: enable flake8-logging when it's not in preview anymore
]
extend-ignore = [
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
]

[tool.ruff.isort]
required-imports = ["from __future__ import annotations"]

0 comments on commit 110cb34

Please sign in to comment.