Skip to content

Commit

Permalink
add pre-commit and use it in ci (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Aug 24, 2022
1 parent f154687 commit be6c763
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ jobs:
with:
python-version: 3.9

- run: pip install -r requirements/linting.txt -r requirements/setup.txt
- run: pip install -r requirements/linting.txt -r requirements/setup.txt pre-commit

- run: make lint

- run: make mypy
- run: pre-commit run -a

docs:
runs-on: ubuntu-latest
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: local
hooks:
- id: lint
name: Lint
entry: make lint
types: [python]
language: system
pass_filenames: false
- id: mypy
name: Mypy
entry: make mypy
types: [python]
language: system
pass_filenames: false
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ black = black arq tests

.PHONY: install
install:
pip install -U pip setuptools
pip install -U pip setuptools pre-commit
pip install -r requirements/all.txt
pip install -e .[watch]
pre-commit install

.PHONY: format
format:
Expand Down
1 change: 0 additions & 1 deletion docs/examples/slow_job_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@
12:42:50: 21.78s → c3dd4acc171541b9ac10b1d791750cde:the_task() try=2 delayed=21.78s
12:42:55: 5.00s ← c3dd4acc171541b9ac10b1d791750cde:the_task ●
^C12:42:57: shutdown on SIGINT ◆ 1 jobs complete ◆ 0 failed ◆ 0 retries ◆ 0 ongoing to cancel

0 comments on commit be6c763

Please sign in to comment.