Skip to content

Commit ea91a67

Browse files
committed
Replace black with ruff
This replaces the `black` with `ruff` as linter and formatter: - Ruff is faster and more accurate - There are more rules enabled in Ruff than in Black - Ruff is more configurable and has more options > [!WARNING] > This will cause a lot of changes to the codebase. > This commit is ignoring those changes for now.
1 parent 695242a commit ea91a67

4 files changed

Lines changed: 261 additions & 144 deletions

File tree

.pre-commit-config.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
repos:
2-
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
3-
- repo: https://github.com/psf/black-pre-commit-mirror
4-
rev: 24.4.2
5-
hooks:
6-
- id: black
7-
# It is recommended to specify the latest version of Python
8-
# supported by your project here, or alternatively use
9-
# pre-commit's default_language_version, see
10-
# https://pre-commit.com/#top_level-default_language_version
11-
language_version: python3.12
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
rev: v0.15.4
11+
hooks:
12+
- id: ruff-check
13+
args: [ --config=ruff.toml --fix ]
14+
- id: ruff-format

0 commit comments

Comments
 (0)