Skip to content

Commit d7fc5be

Browse files
committed
Replace flake8 + isort + flynt with ruff
1 parent b7a85eb commit d7fc5be

File tree

8 files changed

+43
-41
lines changed

8 files changed

+43
-41
lines changed

.flake8

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

.isort.cfg

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

dev_requirements.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
click==8.0.4
2-
black==24.3.0
32
cachetools
4-
flake8==5.0.4
5-
flake8-isort==6.0.0
6-
flynt~=0.69.0
73
mock==4.0.3
84
packaging>=20.4
95
pytest==7.2.0
@@ -16,3 +12,4 @@ ujson>=4.2.0
1612
wheel>=0.30.0
1713
urllib3<2
1814
uvloop
15+
ruff==0.4.5

redis/_parsers/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def parse_geosearch_generic(response, **options):
495495
except KeyError: # it means the command was sent via execute_command
496496
return response
497497

498-
if type(response) != list:
498+
if type(response) != list: # noqa: E721
499499
response_list = [response]
500500
else:
501501
response_list = response

redis/commands/timeseries/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, args):
7878
self.chunk_size = response["chunkSize"]
7979
if "duplicatePolicy" in response:
8080
self.duplicate_policy = response["duplicatePolicy"]
81-
if type(self.duplicate_policy) == bytes:
81+
if type(self.duplicate_policy) == bytes: # noqa: E721
8282
self.duplicate_policy = self.duplicate_policy.decode()
8383

8484
def get(self, item):

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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
"tasks.py",
13+
"venv*",
14+
"whitelist.py",
15+
]
16+
[lint]
17+
ignore = [
18+
"E501",
19+
"E741",
20+
"F405",
21+
"N801",
22+
"N802",
23+
"N803",
24+
"N806",
25+
"N815",
26+
"N818",
27+
]
28+
extend-select = [
29+
"E",
30+
"F",
31+
"FLY",
32+
"I",
33+
"N",
34+
"W",
35+
]
36+
[lint.per-file-ignores]
37+
"redis/commands/search/indexDefinition.py" = ["N999"]
38+
"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)