Skip to content

Commit

Permalink
Use ruff in place of black and reorder-python-imports
Browse files Browse the repository at this point in the history
Unfortunately black and reorder-python-imports are no longer compatible between each other:

asottile/reorder-python-imports#367
asottile/reorder-python-imports#366
psf/black#4175

Take this opportunity to try out ruff.
  • Loading branch information
nicoddemus committed Jan 29, 2024
1 parent 3d48ff9 commit ba34960
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
@@ -1,10 +1,5 @@
exclude: '^($|.*\.bin)'
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
args: [--safe, --quiet]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -18,11 +13,12 @@ repos:
files: ^(CHANGELOG.rst|README.rst|HOWTORELEASE.rst|changelog/.*)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: reorder-python-imports
args: ['--application-directories=.:src']
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
@@ -0,0 +1,8 @@
[build-system]
requires = [
"setuptools",
"setuptools-scm[toml]",
]
build-backend = "setuptools.build_meta"

[tool.ruff]

0 comments on commit ba34960

Please sign in to comment.