Skip to content

Commit 807d234

Browse files
committed
Fix pre-commit documentation and configuration file
1 parent 25a959c commit 807d234

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
default_stages: [ commit ]
1+
default_stages: [ commit, push ]
22
repos:
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:
@@ -18,7 +26,8 @@ repos:
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 ]

doc/user_guide/getting_started.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)