-
-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #692 from WisdomPill/use_ruff
Replaced flake8 and isort with ruff
- Loading branch information
Showing
24 changed files
with
257 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,8 +124,7 @@ jobs: | |
matrix: | ||
tool: | ||
- 'black' | ||
- 'flake8' | ||
- 'isort' | ||
- 'ruff' | ||
- 'mypy' | ||
|
||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
# https://beta.ruff.rs/docs/rules/ | ||
select = [ | ||
# rules from pyflakes | ||
"F", | ||
|
||
# rules from pycodestyle | ||
"E", "W", | ||
|
||
# rules from mccabe | ||
"C90", | ||
|
||
# rules from isort | ||
"I", | ||
|
||
# rules from pyupgrade | ||
"UP", | ||
|
||
# rules from flake8-2020 | ||
"YTT", | ||
|
||
# rules from flake8-annotations | ||
# "ANN", | ||
|
||
# rules from flake8-bandit | ||
"S", | ||
|
||
# rules from flake8-blind-except | ||
"BLE", | ||
|
||
# rules from flake8-boolean-trap | ||
# TODO: "FBT", | ||
|
||
# rules from flake8-bugbear | ||
"B", | ||
|
||
# rules from flake8-builtins | ||
"A", | ||
|
||
# rules from flake8-commas | ||
"COM", | ||
|
||
# rules from flake8-comprehensions | ||
"C4", | ||
|
||
# rules from flake8-datetimez | ||
# TODO: "DTZ", | ||
|
||
# rules from flake8-debugger | ||
"T10", | ||
|
||
# rules from flake8-django | ||
"DJ", | ||
|
||
# rules from flake8-errmsg | ||
"EM", | ||
|
||
# rules from flake8-executable | ||
"EXE", | ||
|
||
# rules from flake8-implicit-str-concat | ||
"ISC", | ||
|
||
# rules from flake8-import-conventions | ||
"ICN", | ||
|
||
# rules from flake8-logging-format | ||
"G", | ||
|
||
# rules from flake8-no-pep420 | ||
"INP", | ||
|
||
# rules from flake8-pie | ||
# TODO: "PIE", | ||
|
||
# rules from flake8-print | ||
"T20", | ||
|
||
# rules from flake8-pyi | ||
"PYI", | ||
|
||
# rules from flake8-pytest-style | ||
# TODO: "PT", | ||
|
||
# rules from flake8-raise | ||
"RSE", | ||
|
||
# rules from flake8-return | ||
"RET", | ||
|
||
# rules from flake8-self | ||
# TODO: "SLF", | ||
|
||
# rules from flake8-simplify | ||
"SIM", | ||
|
||
# rules from flake8-tidy-imports | ||
"TID", | ||
|
||
# rules from flake8-type-checking | ||
"TCH", | ||
|
||
# rules from flake8-gettext | ||
"INT", | ||
|
||
# rules from flake8-unused-arguments | ||
# TODO: "ARG", | ||
|
||
# rules from flake8-use-pathlib | ||
"PTH", | ||
|
||
# removes unused noqa comments | ||
"RUF100", | ||
] | ||
|
||
ignore = [ | ||
"COM812", # missing trailing comma, covered by black | ||
"ANN101", # ignore missing type annotation in self parameter | ||
"S311", # ignore Standard pseudo-random generators because they are not used for cryptographic purposes | ||
] | ||
|
||
fix = true | ||
|
||
# TODO: enable this when python3.6 will stop being supported, | ||
# from april 2024 https://docs.djangoproject.com/en/4.2/releases/3.2/ | ||
#target-version = "py36" | ||
|
||
[flake8-tidy-imports] | ||
## Disallow all relative imports. | ||
ban-relative-imports = "all" | ||
|
||
[per-file-ignores] | ||
# ignore assert statements in tests | ||
"tests/*.py" = ["S101"] | ||
|
||
# ignore SECRET_KEY in settings files in tests | ||
"tests/settings/*.py" = ["S105"] | ||
|
||
# pickle is used on purpose and its use is discouraged | ||
"django_redis/serializers/pickle.py" = ["S301"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Replace isort and flake8 with ruff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .default import DefaultClient | ||
from .herd import HerdClient | ||
from .sentinel import SentinelClient | ||
from .sharded import ShardClient | ||
from django_redis.client.default import DefaultClient | ||
from django_redis.client.herd import HerdClient | ||
from django_redis.client.sentinel import SentinelClient | ||
from django_redis.client.sharded import ShardClient | ||
|
||
__all__ = ["DefaultClient", "HerdClient", "SentinelClient", "ShardClient"] |
Oops, something went wrong.