File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed
Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 1- default_stages : [ commit ]
1+ default_stages : [ commit, push ]
22repos :
33
44 - repo : local
55 hooks :
66 - id : code-format
77 name : code-format
88 types : [ python ]
9- files : " pyproject.toml"
109 pass_filenames : false
1110 language : system
12- entry : poetry run nox -s fix
11+ entry : poetry run nox -s project:fix
12+ stages : [ commit ]
13+
14+ - repo : https://github.com/pre-commit/pre-commit-hooks
15+ rev : v4.4.0
16+ stages : [ commit ]
17+ hooks :
18+ - id : check-yaml
19+ - id : end-of-file-fixer
20+ - id : trailing-whitespace
1321
1422 - repo : local
1523 hooks :
1826 types : [ python ]
1927 pass_filenames : false
2028 language : system
21- entry : poetry run nox -s type-check
29+ entry : poetry run nox -s lint:typing
30+ stages : [ push ]
2231
2332 - repo : local
2433 hooks :
@@ -27,11 +36,5 @@ repos:
2736 types : [ python ]
2837 pass_filenames : false
2938 language : system
30- entry : poetry run nox -s lint
31-
32- - repo : https://github.com/pre-commit/pre-commit-hooks
33- rev : v4.4.0
34- hooks :
35- - id : check-yaml
36- - id : end-of-file-fixer
37- - id : trailing-whitespace
39+ entry : poetry run nox -s lint:code
40+ stages : [ push ]
Original file line number Diff line number Diff line change @@ -161,10 +161,12 @@ forward and you just can use the example *noxfile.py* bellow.
161161
162162
163163
164- 6. Setup the pre-commit hooks
165- +++++++++++++++++++++++++++++
164+ 6. Setup the pre-commit hooks [optional]
165+ ++++++++++++++++++++++++++++++++++++++++
166166
167- #. Add the following .pre-commit-config.yaml to your project root
167+ #. Add a :code: `.pre-commit-config.yaml ` file to your project root
168+
169+ If you want to reuse Nox tasks in the pre-commit hooks, feel free to get some inspiration from the Python toolbox itself:
168170
169171 .. literalinclude :: ../../.pre-commit-config.yaml
170172 :language: yaml
You can’t perform that action at this time.
0 commit comments