Skip to content

Commit

Permalink
Use Ruff instead of flake8/black
Browse files Browse the repository at this point in the history
Ruff is a new toy in town. It's to install, it comes with many batteries
included, it has a pretty good integration into text editors and it
boosts my productivity. So this patch switches to Ruff from flake8 and
black.

In addition to that switch, this patch also drops the pre-commit
configuration since it actually never worked for me.
  • Loading branch information
ikalnytskyi committed May 5, 2024
1 parent 4391335 commit 71dd62d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2

- name: Run pre-commit
run: python -m pip install tox && python -m tox -e pre-commit
- name: Run ruff
run: pipx run tox -e lint

test:
strategy:
Expand All @@ -44,4 +44,4 @@ jobs:
if: matrix.os == 'macos-latest'

- name: Run pytest
run: python -m pip install tox && python -m tox -e py3
run: pipx run tox -e py3
26 changes: 0 additions & 26 deletions .pre-commit-config.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ creds = "httpie_credential_store:CredsAuthPlugin"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.ruff]
line-length = 88
target-version = "py38"
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3, pre-commit
envlist = py3, lint

[testenv]
deps = poetry
Expand All @@ -8,8 +8,10 @@ commands =
poetry install -v
poetry run pytest -vv

[testenv:pre-commit]
[testenv:lint]
skip_install = true
deps = pre-commit
deps =
ruff >= 0.4.2, < 0.5.0
commands =
pre-commit run --all-files --show-diff-on-failure
ruff check {args:.}
ruff format --check --diff {args:.}

0 comments on commit 71dd62d

Please sign in to comment.