Skip to content

Commit cd66c8a

Browse files
committed
Format code with ruff instead of black
1 parent a8c0e0f commit cd66c8a

File tree

3 files changed

+23
-35
lines changed

3 files changed

+23
-35
lines changed

.isort.cfg

-4
This file was deleted.

.pre-commit-config.yaml

+7-31
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,20 @@
11
repos:
2-
32
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
3+
rev: v5.0.0
54
hooks:
65
- id: check-ast
76
- id: check-merge-conflict
87
- id: debug-statements
98
- id: trailing-whitespace
10-
119
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
1210
rev: '2.7.3'
1311
hooks:
1412
- id: editorconfig-checker
1513
alias: ec
16-
17-
- repo: https://github.com/psf/black
18-
rev: 24.1.1
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.9.6
1916
hooks:
20-
- id: black
21-
22-
- repo: https://github.com/pycqa/isort
23-
rev: 5.13.2
24-
hooks:
25-
- id: isort
26-
27-
- repo: https://github.com/pycqa/flake8
28-
rev: '7.0.0'
29-
hooks:
30-
- id: flake8
31-
additional_dependencies:
32-
- flake8-awesome
33-
- flake8-bugbear
34-
- flake8-comprehensions
35-
- flake8-debugger
36-
- flake8-deprecated
37-
- flake8-fixme
38-
- flake8-pep3101
39-
- flake8-polyfill
40-
- flake8-print
41-
args:
42-
- "--ignore=A003,C408,I001,I003,I004,I005,I900,IF100,Q000,G001,PT001,PT013,PT023,S311,S,F401,R504,R505,T201"
43-
- "--per-file-ignores=*test*/*:S101,smoke.py:S101,S501,E501,sanitize.py:E501,R503,authors.py:ECE001,W504,batou:T102,conf.py:A001"
44-
- "--max-line-length=88"
17+
- id: ruff
18+
args: [--fix, --exit-non-zero-on-fix]
19+
types_or: [python, pyi]
20+
- id: ruff-format

pyproject.toml

+16
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ zeit_nightwatch = "zeit.nightwatch.pytest"
2525
[project.urls]
2626
Repository = "https://github.com/ZeitOnline/zeit.nightwatch"
2727

28+
2829
[build-system]
2930
requires = ["hatchling", "hatch-fancy-pypi-readme"]
3031
build-backend = "hatchling.build"
@@ -58,3 +59,18 @@ underlines = ["-", "+"]
5859
directory = "change"
5960
name = "Changes" # I'd love to omit the category, but that requires copy&paste of the whole template
6061
showcontent = true
62+
63+
64+
[tool.ruff]
65+
line-length = 100
66+
67+
[tool.ruff.lint]
68+
select = ["E", "F", "I"]
69+
fixable = ["ALL"]
70+
71+
[tool.ruff.format]
72+
quote-style = "double"
73+
74+
[tool.ruff.lint.isort]
75+
from-first = true
76+
lines-after-imports = 2

0 commit comments

Comments
 (0)