Skip to content

Commit e2652b6

Browse files
committed
chore(dev): switch from black to ruff format
One tool fewer to install and maintain.
1 parent cfef85b commit e2652b6

File tree

6 files changed

+21
-22
lines changed

6 files changed

+21
-22
lines changed

.dir-locals.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;;; For more information see (info "(emacs) Directory Variables")
33

44
((python-mode
5-
(eval add-hook 'before-save-hook 'blacken-buffer nil t))
5+
(mode . ruff-format-on-save))
66
(sh-mode
77
(mode . shfmt-on-save)
88
(shfmt-arguments "-s")

.github/renovate.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@
3939
"commitMessageTopic": "{{depName}}",
4040
"semanticCommitScope": "pre-commit"
4141
},
42-
{
43-
"matchPackagePatterns": ["(^|/)black(-pre-commit-mirror)?$"],
44-
"versioning": "pep440",
45-
"groupName": "black"
46-
},
4742
{
4843
"matchPackagePatterns": ["(^|/)gitlint$"],
4944
"versioning": "pep440",

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ repos:
4949
types: [text]
5050
files: ^(helpers/python|.+\.py)$
5151
exclude: ^completions/
52-
53-
- repo: https://github.com/psf/black-pre-commit-mirror
54-
rev: 23.1.0
55-
hooks:
56-
- id: black
52+
- id: ruff-format
5753
types: [text]
5854
files: ^(helpers/python|.+\.py)$
5955
exclude: ^completions/

doc/testing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ and [pexpect](https://pexpect.readthedocs.io/).
1111

1212
## Coding style
1313

14-
For the Python part, all of it is formatted using
15-
[Black](https://github.com/psf/black), and we also run
16-
[Ruff](https://github.com/charliermarsh/ruff) on it.
14+
For the Python part, all of it is checked and formatted using
15+
[Ruff](https://docs.astral.sh/ruff/).
1716

1817
## Installing dependencies
1918

pyproject.toml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
[tool.black]
2-
line-length = 79
3-
target-version = ["py36", "py37", "py38", "py39", "py310"]
4-
51
[tool.ruff]
62
line-length = 79
73
target-version = "py37"
84
select = ["E", "F", "B"]
95
ignore = [
10-
"E50", # Black
11-
"E70", # Black
12-
6+
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
7+
# (keep order of ignores here same as ^there for maintainability)
8+
"W191",
9+
"E111",
10+
"E114",
11+
"E117",
12+
"D206",
13+
"D300",
14+
"Q000",
15+
"Q001",
16+
"Q002",
17+
"Q003",
18+
"COM812",
19+
"COM819",
20+
"ISC001",
21+
"ISC002",
22+
"E501",
1323
]
1424
fix = true
1525

test/requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
-r requirements.txt
44

5-
black==23.1.0
65
mypy==1.2.0
76
ruff==0.1.6

0 commit comments

Comments
 (0)