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

Use pre-commit hooks in tox configuration #2057

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,18 @@ repos:
hooks:
# Run the linter.
- id: ruff

# Run the formatter.
- id: ruff-format

# Run the linter in fix-only mode.
- id: ruff
alias: ruff-fix-only
stages: [manual]
args: [--fix-only]

# Run the formatter in check mode.
- id: ruff-format
alias: ruff-format-check
stages: [manual]
args: [--check]
16 changes: 6 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,18 @@ envlist =
package = skip
ignore_errors = True
deps =
codespell~=2.0
ruff~=0.6.2
pre-commit
commands =
ruff --version
ruff check
ruff format --check
codespell .
pre-commit run --all-files codespell
pre-commit run --all-files --hook-stage manual ruff-format-check

[testenv:format]
package = skip
deps =
ruff~=0.6.2
pre-commit
commands =
ruff --version
ruff check --fix-only
ruff format
pre-commit run --all-files --hook-stage manual ruff-fix-only
pre-commit run --all-files ruff-format

[testenv:type]
deps =
Expand Down