Skip to content

Commit

Permalink
Run pre-commit as a separate job instead of from tox
Browse files Browse the repository at this point in the history
  • Loading branch information
jleclanche committed Oct 18, 2022
1 parent 2d39360 commit 831ba5c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Linting

on:
push:

pull_request:
# The branches below must be a subset of the branches above
branches: [master]

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ optional = true
[tool.poetry.group.dev.dependencies]
black = ">=22.6.0"
isort = ">=5.10.1"
pre-commit = ">=2.20.0"
pytest = ">=7.1.2"
pytest-django = ">=4.5.2"
mypy = ">=0.971"
Expand Down
8 changes: 1 addition & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ skip_missing_interpreters = True
python =
3.7: py37
3.8: py38
3.9: py39, pre-commit
3.9: py39
3.10: py310

[testenv]
Expand All @@ -36,12 +36,6 @@ deps =
pytest-django
pytest-cov

[testenv:pre-commit]
skip_install = True
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure


; Need to mention the env because we use tests.settings
[testenv:docs-django{32,40,main}-{postgres,mysql,sqlite}]
extras = docs
Expand Down

0 comments on commit 831ba5c

Please sign in to comment.