Skip to content

Commit

Permalink
Use ruff instead of Black
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Dec 11, 2024
1 parent 53c2306 commit ed560be
Show file tree
Hide file tree
Showing 6 changed files with 535 additions and 591 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 4.3.4 / Unreleased

- Test with Python 3.13
- Use ruff instead of black/isort

## 4.3.3 / 2024-05-04

Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ verify_ssl = true
name = "pypi"

[dev-packages]
black = "~=24.3"
# black = "~=24.3"
Cheroot = "*" # "~=8.5"
cx_Freeze = {version = "*", markers="sys_platform == 'win32'"}
isort = "*"
# isort = "*"
mypy = "*"
Paste = "*" # "~=2.0"
pylint = "*"
Expand Down
1,043 changes: 494 additions & 549 deletions Pipfile.lock

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.tox
| \.venv
| \.eggs
| \.cache
| build
| __pycache__
| dist
| \.*
# [tool.black]
# line-length = 88
# target-version = ['py38', 'py39', 'py310', 'py311']
# include = '\.pyi?$'
# exclude = '''
# /(
# \.git
# | \.hg
# | \.tox
# | \.venv
# | \.eggs
# | \.cache
# | build
# | __pycache__
# | dist
# | \.*

)/
'''
# )/
# '''

[tool.isort]
# See https://black.readthedocs.io/en/stable/compatible_configs.html
profile = "black"
src_paths = ["wsgidav", "tests"]
# [tool.isort]
# # See https://black.readthedocs.io/en/stable/compatible_configs.html
# profile = "black"
# src_paths = ["wsgidav", "tests"]


[tool.ruff]
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

cheroot~=10.0
Paste~=3.0
black~=24.3
pytest~=8.2
pytest-cov~=5.0
# recommonmark
Expand Down
33 changes: 16 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,30 @@ deps =
commands =
ruff -V
ruff check wsgidav tests setup.py
ruff format --check wsgidav tests setup.py

[testenv:check]
description = Check Black formatting compliance and add flake8-bugbear checks
skip_install = true
deps =
black ~=24.3
isort
{[testenv:lint]deps}
changedir = {toxinidir}
commands =
{[testenv:lint]commands}
isort --check-only --profile black wsgidav tests setup.py
black --check --diff wsgidav tests setup.py
; [testenv:check]
; description = Check Black formatting compliance and add flake8-bugbear checks
; skip_install = true
; deps =
; black ~=24.3
; isort
; {[testenv:lint]deps}
; changedir = {toxinidir}
; commands =
; {[testenv:lint]commands}
; isort --check-only --profile black wsgidav tests setup.py
; black --check --diff wsgidav tests setup.py


[testenv:format]
description = Reformat python code using Black and isort
description = Reformat python code using ruff (Black, isort, and pyupgrade)
deps =
{[testenv:check]deps}
{[testenv:lint]deps}
changedir = {toxinidir}
commands =
ruff check --fix wsgidav tests setup.py
; ruff format wsgidav tests setup.py
isort --profile black wsgidav tests setup.py {posargs}
black wsgidav tests setup.py
ruff format wsgidav tests setup.py
{[testenv:lint]commands}


Expand Down

0 comments on commit ed560be

Please sign in to comment.