Skip to content

Commit 1e47fbe

Browse files
committed
enable a bunch of ruff rules
1 parent 093546a commit 1e47fbe

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

minio_storage/storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _open(self, name, mode="rb"):
144144
try:
145145
f = self.file_class(self._sanitize_path(name), mode, self)
146146
except merr.MinioException as e:
147-
raise minio_error(f"File {name} could not be saved: {str(e)}", e) from e
147+
raise minio_error(f"File {name} could not be saved: {e!s}", e) from e
148148
return f
149149

150150
def _save(self, name: str, content: T.BinaryIO) -> str:
@@ -170,7 +170,7 @@ def delete(self, name: str) -> None:
170170
obj = self.client.get_object(self.bucket_name, name)
171171
except merr.InvalidResponseError as error:
172172
raise minio_error(
173-
"Could not obtain file {} " "to make a copy of it".format(name),
173+
f"Could not obtain file {name} to make a copy of it",
174174
error,
175175
) from error
176176

pyproject.toml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,27 @@ profile = "black"
4848
skip = [".tox", "migrations", "node_modules", ".git", ".eggs"]
4949

5050
[tool.ruff]
51+
target-version = 'py38'
5152
line-length = 88
5253
select = [
54+
"B",
55+
"C4",
56+
"C9",
57+
"DJ",
5358
"E",
5459
"F",
55-
"W",
5660
"I",
57-
"B",
61+
"ISC",
62+
"NPY",
63+
"PLC",
64+
"PLE",
65+
"PLW",
66+
"RUF010",
67+
"RUF013",
68+
"S5",
69+
"S6",
5870
"UP",
59-
"DJ",
71+
"W",
6072
]
6173
ignore = ["E203"]
6274
exclude = [

tests/django_minio_storage_tests/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@
115115
"NAME": "django.contrib.auth.password_validation"
116116
".UserAttributeSimilarityValidator"
117117
},
118-
{"NAME": "django.contrib.auth.password_validation" ".MinimumLengthValidator"},
119-
{"NAME": "django.contrib.auth.password_validation" ".CommonPasswordValidator"},
120-
{"NAME": "django.contrib.auth.password_validation" ".NumericPasswordValidator"},
118+
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
119+
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
120+
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
121121
]
122122

123123

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ setenv=
6565
PYTHONWARNINGS=ignore
6666
basepython = python3
6767
deps =
68-
ruff==0.0.270
68+
ruff==0.0.277
6969
black==22.3.0
7070
commands =
7171
ruff check .
@@ -77,7 +77,7 @@ setenv=
7777
basepython = python3
7878
deps =
7979
pyupgrade-directories
80-
ruff==0.0.270
80+
ruff==0.0.277
8181
isort==5.12.0
8282
black==23.3.0
8383
commands =

0 commit comments

Comments
 (0)