File tree Expand file tree Collapse file tree
{% if AddPreCommit %}.githhooks{% endif %} Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ AddOnlineDocumentation:
8989 default : " {{ template_profile != 'minimum' }}"
9090 help : Online documentation using Read the Docs
9191
92+ AddPreCommit :
93+ when : " {{ template_profile == 'ask' }}"
94+ type : bool
95+ default : " {{ template_profile != 'minimum' }}"
96+ help : Add Pre-commit hooks to check code style and quality
9297
9398# internal fields
9499_subdirectory : template
Original file line number Diff line number Diff line change @@ -77,11 +77,13 @@ ruff . --fix
7777
7878To fix readability of your code style you can use [yapf](https://github.com/google/yapf).
7979
80+ {% if AddPreCommit -%}
8081You can enable automatic linting with `ruff` on commit by enabling the git hook from `.githooks/pre-commit`, like so:
8182
8283```shell
8384git config --local core.hooksPath .githooks
8485```
86+ {% - endif %}
8587
8688## Generating the API docs
8789
File renamed without changes.
You can’t perform that action at this time.
0 commit comments