Skip to content

Commit

Permalink
Replaced flake8 and isort with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
WisdomPill committed Nov 1, 2023
1 parent b6ea4b4 commit ac98af3
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ jobs:
matrix:
tool:
- 'black'
- 'flake8'
- 'isort'
- 'ruff'
- 'mypy'

steps:
Expand Down
129 changes: 129 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# 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
# TODO: "B",

# rules from flake8-builtins
# TODO: "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
# TODO: "DJ",

# rules from flake8-errmsg
# "EM",

# rules from flake8-executable
# TODO: "EXE",

# rules from flake8-implicit-str-concat
# "ISC",

# rules from flake8-import-conventions
# "ICN",

# rules from flake8-logging-format
# TODO: "G",

# rules from flake8-no-pep420
# TODO: "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
# TODO: "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
# could be enabled easily
# TODO: "PTH",

# removes unused noqa comments
# "RUF100",
]

ignore = [
"COM812", # missing trailing comma, covered by black
"ANN101", # ignore missing type annotation in self parameter
]

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"
11 changes: 4 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ multi_line_output = 3
minversion = 3.15.0
envlist =
black
flake8
isort
ruff
mypy
# tests against released versions
py{36,37,38,39,310,311}-dj{22,31,32,40,41,42}-redislatest
Expand Down Expand Up @@ -131,19 +130,17 @@ deps =
lz4>=0.15
pyzstd>=0.15

[testenv:{black,flake8,isort,mypy}]
[testenv:{black,ruff,mypy}]
basepython = python3
envdir={toxworkdir}/lint
commands =
black: black --target-version py36 {posargs:--check --diff} setup.py django_redis/ tests/
flake8: flake8 {posargs} setup.py django_redis/ tests/
isort: isort {posargs:--check-only --diff} django_redis/ tests/
ruff: ruff {posargs:check --show-fixes} django_redis/ tests/
mypy: mypy {posargs:--cobertura-xml-report .} django_redis tests
deps =
black
django-stubs
flake8
isort >= 5.0.2
ruff
lxml
mypy
# typing dependencies
Expand Down

0 comments on commit ac98af3

Please sign in to comment.