Skip to content

Commit 381af3b

Browse files
committed
check format using ruff
1 parent 2a5845d commit 381af3b

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pip-log.txt
3030
.coverage
3131
.tox
3232
.pytest_cache/
33+
.ruff_cache/
3334
nosetests.xml
3435

3536
# Translations

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 24.8.0
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.5.7
44
hooks:
5-
- id: black
6-
exclude: ^(oauth2_provider/migrations/|tests/migrations/)
5+
- id: ruff-format
76
- repo: https://github.com/pre-commit/pre-commit-hooks
87
rev: v4.6.0
98
hooks:

pyproject.toml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
[tool.black]
2-
line-length = 110
3-
target-version = ['py38']
4-
exclude = '''
5-
^/(
6-
oauth2_provider/migrations/
7-
| tests/migrations/
8-
| .tox
9-
)
10-
'''
11-
121
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
132
[tool.codespell]
143
skip = '.git,package-lock.json,locale,AUTHORS,tox.ini'
154
check-hidden = true
165
ignore-regex = '.*pragma: codespell-ignore.*'
176
ignore-words-list = 'assertIn'
7+
8+
[tool.ruff]
9+
line-length = 110
10+
exclude = [".tox", "oauth2_provider/migrations/", "tests/migrations/", "manage.py"]

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ markers =
4242

4343
[testenv]
4444
commands =
45+
ruff format
4546
pytest {posargs}
4647
coverage report
4748
coverage xml
@@ -67,6 +68,7 @@ deps =
6768
pytest-xdist
6869
pytest-mock
6970
requests
71+
ruff>=0.5
7072
passenv =
7173
PYTEST_ADDOPTS
7274

@@ -106,7 +108,6 @@ deps =
106108
flake8
107109
flake8-isort
108110
flake8-quotes
109-
flake8-black
110111

111112
[testenv:migrations]
112113
setenv =

0 commit comments

Comments
 (0)