Skip to content

Commit 8ce6009

Browse files
committed
Replace flake8 + isort + flynt with ruff
1 parent 483c021 commit 8ce6009

File tree

7 files changed

+46
-13
lines changed

7 files changed

+46
-13
lines changed

.isort.cfg

Lines changed: 0 additions & 5 deletions
This file was deleted.

dev_requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
build
22
black==24.3.0
33
click==8.0.4
4-
flake8-isort
5-
flake8
6-
flynt~=0.69.0
74
invoke==2.2.0
85
mock
96
packaging>=20.4
@@ -12,6 +9,7 @@ pytest-asyncio>=0.23.0,<0.24.0
129
pytest-cov
1310
pytest-profiling==1.8.1
1411
pytest-timeout
12+
ruff==0.9.6
1513
ujson>=4.2.0
1614
uvloop
1715
vulture>=2.3.0

doctests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pip install -r dev_requirements.txt
2121
pip install -r doctests/requirements.txt
2222
```
2323

24-
Note - the CI process, runs the basic ```black``` and ```isort``` linters against the examples. Assuming
25-
the requirements above have been installed you can run ```black yourfile.py``` and ```isort yourfile.py```
24+
Note - the CI process, runs linters against the examples. Assuming
25+
the requirements above have been installed you can run ```ruff check yourfile.py``` and ```ruff format yourfile.py```
2626
locally to validate the linting, prior to CI.
2727

2828
Just include necessary assertions in the example file and run

redis/auth/token.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import datetime, timezone
33

44
import jwt
5+
56
from redis.auth.err import InvalidTokenSchemaErr
67

78

redis/ocsp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from cryptography.hazmat.primitives.hashes import SHA1, Hash
1616
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
1717
from cryptography.x509 import ocsp
18+
1819
from redis.exceptions import AuthorizationError, ConnectionError
1920

2021

ruff.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
target-version = "py38"
2+
line-length = 88
3+
exclude = [
4+
"*.egg-info",
5+
"*.pyc",
6+
".git",
7+
".venv*",
8+
".venv*",
9+
"build",
10+
"dist",
11+
"docker",
12+
"docs/*",
13+
"doctests/*",
14+
"tasks.py",
15+
"venv*",
16+
"whitelist.py",
17+
]
18+
[lint]
19+
ignore = [
20+
"E501",
21+
"E741",
22+
"F405",
23+
"N801",
24+
"N802",
25+
"N803",
26+
"N806",
27+
"N815",
28+
"N818",
29+
]
30+
extend-select = [
31+
"E",
32+
"F",
33+
"FLY",
34+
"I",
35+
"N",
36+
"W",
37+
]
38+
[lint.per-file-ignores]
39+
"redis/commands/search/indexDefinition.py" = ["N999"]
40+
"tests/*" = ["I"]

tasks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ def build_docs(c):
2727
@task
2828
def linters(c):
2929
"""Run code linters"""
30-
run("flake8 tests redis")
30+
run("ruff check tests redis")
3131
run("black --target-version py37 --check --diff tests redis")
32-
run("isort --check-only --diff tests redis")
3332
run("vulture redis whitelist.py --min-confidence 80")
34-
run("flynt --fail-on-change --dry-run tests redis")
3533

3634

3735
@task

0 commit comments

Comments
 (0)