Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable a bunch of ruff rules #133

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions minio_storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _open(self, name, mode="rb"):
try:
f = self.file_class(self._sanitize_path(name), mode, self)
except merr.MinioException as e:
raise minio_error(f"File {name} could not be saved: {str(e)}", e) from e
raise minio_error(f"File {name} could not be saved: {e!s}", e) from e
return f

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

Expand Down
18 changes: 15 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,27 @@ profile = "black"
skip = [".tox", "migrations", "node_modules", ".git", ".eggs"]

[tool.ruff]
target-version = 'py38'
line-length = 88
select = [
"B",
"C4",
"C9",
"DJ",
"E",
"F",
"W",
"I",
"B",
"ISC",
"NPY",
"PLC",
"PLE",
"PLW",
"RUF010",
"RUF013",
"S5",
"S6",
"UP",
"DJ",
"W",
]
ignore = ["E203"]
exclude = [
Expand Down
6 changes: 3 additions & 3 deletions tests/django_minio_storage_tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
"NAME": "django.contrib.auth.password_validation"
".UserAttributeSimilarityValidator"
},
{"NAME": "django.contrib.auth.password_validation" ".MinimumLengthValidator"},
{"NAME": "django.contrib.auth.password_validation" ".CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation" ".NumericPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]


Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ setenv=
PYTHONWARNINGS=ignore
basepython = python3
deps =
ruff==0.0.270
ruff==0.0.277
black==22.3.0
commands =
ruff check .
Expand All @@ -77,7 +77,7 @@ setenv=
basepython = python3
deps =
pyupgrade-directories
ruff==0.0.270
ruff==0.0.277
isort==5.12.0
black==23.3.0
commands =
Expand Down