File tree Expand file tree Collapse file tree 4 files changed +9
-0
lines changed
{% if AddPreCommit %}.githhooks{% endif %} Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 15
15
16
16
### Changed
17
17
18
+ * pre-commit script is optional ([ #457 ] ( https://github.com/NLeSC/python-template/issues/457 ) )
18
19
* CHANGELOG.md is now optional ([ #462 ] ( https://github.com/NLeSC/python-template/issues/462 ) )
19
20
* Moved to src/ based layout for generated packages
20
21
* Moved from setup.cfg/.py to pyproject.toml [ #351 ] ( https://github.com/NLeSC/python-template/issues/351 )
Original file line number Diff line number Diff line change @@ -101,6 +101,12 @@ AddOnlineDocumentation:
101
101
default : " {{ template_profile != 'minimum' }}"
102
102
help : Online documentation using Read the Docs
103
103
104
+ AddPreCommit :
105
+ when : " {{ template_profile == 'ask' }}"
106
+ type : bool
107
+ default : " {{ template_profile != 'minimum' }}"
108
+ help : Add pre-commit hook to check code style and format on every commit?
109
+
104
110
# internal fields
105
111
_subdirectory : template
106
112
Original file line number Diff line number Diff line change @@ -77,11 +77,13 @@ ruff . --fix
77
77
78
78
To fix readability of your code style you can use [yapf](https://github.com/google/yapf).
79
79
80
+ {% - if AddPreCommit -%}
80
81
You can enable automatic linting with `ruff` on commit by enabling the git hook from `.githooks/pre-commit`, like so:
81
82
82
83
```shell
83
84
git config --local core.hooksPath .githooks
84
85
```
86
+ {% - endif -%}
85
87
86
88
## Generating the API docs
87
89
File renamed without changes.
You can’t perform that action at this time.
0 commit comments