Skip to content

Commit 7842831

Browse files
committed
Replace flake8 + isort + flynt with ruff
1 parent 8427c7b commit 7842831

File tree

6 files changed

+44
-14
lines changed

6 files changed

+44
-14
lines changed

.isort.cfg

-5
This file was deleted.

dev_requirements.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
black==24.3.0
21
click==8.0.4
3-
flake8-isort
4-
flake8
5-
flynt~=0.69.0
62
invoke==2.2.0
73
mock
84
packaging>=20.4
@@ -11,6 +7,7 @@ pytest-asyncio>=0.23.0,<0.24.0
117
pytest-cov
128
pytest-profiling==1.8.1
139
pytest-timeout
10+
ruff==0.9.6
1411
ujson>=4.2.0
1512
uvloop
1613
vulture>=2.3.0

doctests/README.md

+2-2
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/ocsp.py

+1
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

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

tasks.py

+1-3
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)