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

replace flake8 with ruff #756

Merged
merged 2 commits into from
Aug 20, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: flake8
- id: ruff
args: [ --fix ]
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.ruff]
exclude = [
".tox",
"docs/*",
"*/migrations/*",
"tests/settings/*",
"sorl/thumbnail/__init__.py",
"sorl/thumbnail/admin/__init__.py"
]
line-length = 100

[tool.ruff.lint]
select = ["B", "C901", "E", "F", "W"]
ignore = ["B904", "B017"]

[tool.ruff.lint.mccabe]
max-complexity = 15
16 changes: 0 additions & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
[bdist_wheel]
universal = 0

;; flake8 analyzes and detect varios errors in the source code.

[flake8]
# D105 - Missing docstring in magic method `__func__`
ignore = D105,W503
max-line-length = 100
exclude = .git,
.tox,
docs/*,
*/migrations/*,
tests/settings/*,
sorl/thumbnail/__init__.py,
sorl/thumbnail/admin/__init__.py

max_complexity = 15

;; Coverage.py, Code coverage testing for Python.

[cov:run]
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ commands =
[testenv:py38-qa]
skip_install = True
deps =
flake8
flake8-bugbear
ruff
rstvalidator
commands =
flake8 --show-source sorl/
ruff check sorl/
python -m rstvalidator README.rst CHANGES.rst CONTRIBUTING.rst
Loading