Skip to content

Commit 981f242

Browse files
authored
Merge pull request #158 from ticosax/switch-to-ruff
Replace flake8 and isort with ruff
2 parents e0934fb + b0b26a7 commit 981f242

File tree

5 files changed

+11
-36
lines changed

5 files changed

+11
-36
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ repos:
1616
rev: v0.32.2
1717
hooks:
1818
- id: markdownlint
19-
- repo: https://github.com/asottile/pyupgrade
20-
rev: v3.3.1
19+
- repo: https://github.com/charliermarsh/ruff-pre-commit
20+
# Ruff version.
21+
rev: 'v0.0.257'
2122
hooks:
22-
- id: pyupgrade
23-
args: [--py37-plus]
24-
- repo: https://github.com/asottile/yesqa
25-
rev: v1.4.0
26-
hooks:
27-
- id: yesqa
23+
- id: ruff
2824
- repo: https://github.com/psf/black
2925
rev: 22.12.0
3026
hooks:
@@ -33,22 +29,3 @@ repos:
3329
- "--line-length"
3430
- "119"
3531
exclude: ^django_fsm_log/migrations|^docs/
36-
- repo: https://github.com/pycqa/isort
37-
rev: 5.12.0
38-
hooks:
39-
- id: isort
40-
exclude: ^django_fsm_log/migrations
41-
- repo: https://github.com/PyCQA/flake8
42-
rev: 6.0.0
43-
hooks:
44-
- id: flake8
45-
additional_dependencies:
46-
- flake8-bugbear
47-
- flake8-comprehensions
48-
- flake8-print
49-
- flake8-tidy-imports
50-
- flake8-typing-imports
51-
args:
52-
- "--max-line-length"
53-
- "119"
54-
exclude: ^django_fsm_log/migrations

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ tox
257257

258258
### Linting with pre-commit
259259

260-
We use flake8, isort, black and more, all configured and check via [pre-commit](https://pre-commit.com/).
260+
We use ruff, black and more, all configured and check via [pre-commit](https://pre-commit.com/).
261261
Before committing, run the following:
262262

263263
```bash

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ profile = "black"
88
py_version = 310
99
line_length = 119
1010
skip_glob = "django_fsm_log/migrations/*"
11+
12+
[tool.ruff]
13+
line-length = 119
14+
target-version = "py310"
15+
select = ["E", "F", "I", "B", "C4", "T20", "TID", "UP"]
16+
exclude = ["django_fsm_log/migrations", ".tox", "build"]

setup.cfg

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,3 @@ markers =
66
ignore_article: Configure the settings DJANGO_FSM_LOG_IGNORED_MODELS to ignore
77
Article Model.
88
pending_objects: Install PendingStateLogManager on StateLog
9-
10-
[flake8]
11-
max_line_length = 119
12-
exclude =
13-
django_fsm_log/migrations/
14-
.tox/
15-
build/

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ envlist =
55
py{38,39,310}-dj-4.0
66
py{38,39,310}-dj-4.1
77
py{310}-dj-master
8-
flake8
98

109
[gh-actions]
1110
python =

0 commit comments

Comments
 (0)