Skip to content

Commit

Permalink
Use generic name for linting job
Browse files Browse the repository at this point in the history
  • Loading branch information
bittner committed Feb 10, 2024
1 parent 5b97c45 commit 23ba624
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
fail-fast: false
matrix:
env:
- ruff
- lint
- format
- package
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ tox list
```

```console
# run just flake8 and the tests for Python 3.10
tox -e flake8,py310
# run just linting and the tests for Python 3.12
tox -e lint,py312
```

```console
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ addopts = "--color=yes --doctest-modules --ignore=pyclean/py2clean.py --ignore=p

[tool.ruff]
extend-exclude = ["py2clean.py", "py3clean.py", "pypyclean.py"]
extend-select = ["ALL"]
extend-ignore = ["ANN", "D", "FBT002", "INP001", "Q000", "TRY200", "UP"]

[tool.ruff.format]
quote-style = "single"
exclude = ["py2clean.py", "py3clean.py", "pypyclean.py"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint]
extend-select = ["ALL"]
extend-ignore = ["ANN", "B904", "D", "FBT002", "INP001", "Q000", "UP"]

[tool.ruff.lint.per-file-ignores]
"pyclean/cli.py" = ["B904", "BLE001"]
"pyclean/compat.py" = ["C408"]
"pyclean/modern.py" = ["B028", "B904"]
Expand Down
16 changes: 8 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[tox]
envlist =
ruff
lint
format
py2{7}
pypy2{7}
Expand Down Expand Up @@ -40,7 +40,7 @@ setenv =
GIT_TAG={posargs}

[testenv:format]
description = Ensure consistent code style
description = Ensure consistent code style (Ruff)
skip_install = true
deps = ruff
commands = ruff format {posargs:--check --diff .}
Expand All @@ -51,6 +51,12 @@ skip_install = true
deps = reuse
commands = reuse {posargs:lint}

[testenv:lint]
description = Lightening-fast linting (Ruff)
skip_install = true
deps = ruff
commands = ruff check {posargs:.}

[testenv:package]
description = Build package and check metadata (or upload package)
skip_install = true
Expand All @@ -64,9 +70,3 @@ passenv =
TWINE_USERNAME
TWINE_PASSWORD
TWINE_REPOSITORY_URL

[testenv:ruff]
description = Lightening-fast linting for Python
skip_install = true
deps = ruff
commands = ruff check {posargs:--show-source .}

0 comments on commit 23ba624

Please sign in to comment.