Skip to content

Commit 63077d7

Browse files
committed
Make pre-commit optional
Fixes #457
1 parent 977268c commit 63077d7

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

copier.yml

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

template/README.dev.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ ruff . --fix
7777

7878
To fix readability of your code style you can use [yapf](https://github.com/google/yapf).
7979

80+
{% if AddPreCommit -%}
8081
You can enable automatic linting with `ruff` on commit by enabling the git hook from `.githooks/pre-commit`, like so:
8182

8283
```shell
8384
git config --local core.hooksPath .githooks
8485
```
86+
{%- endif %}
8587

8688
## Generating the API docs
8789

template/.githooks/pre-commit renamed to template/{% if AddPreCommit %}.githhooks{% endif %}/pre-commit

File renamed without changes.

0 commit comments

Comments
 (0)