Skip to content

Commit

Permalink
Merge pull request #487 from NLeSC/457-optional-precommit
Browse files Browse the repository at this point in the history
Make pre-commit optional
  • Loading branch information
lyashevska authored Aug 21, 2024
2 parents aa7326f + a5ad458 commit 1d454b0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

### Changed

* pre-commit script is optional ([#457](https://github.com/NLeSC/python-template/issues/457))
* CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462))
* Moved to src/ based layout for generated packages
* Moved from setup.cfg/.py to pyproject.toml [#351](https://github.com/NLeSC/python-template/issues/351)
Expand Down
6 changes: 6 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ AddOnlineDocumentation:
default: "{{ template_profile != 'minimum' }}"
help: Online documentation using Read the Docs

AddPreCommit:
when: "{{ template_profile == 'ask' }}"
type: bool
default: "{{ template_profile != 'minimum' }}"
help: Add pre-commit hook to check code style and format on every commit?

# internal fields
_subdirectory: template

Expand Down
2 changes: 2 additions & 0 deletions template/README.dev.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ ruff . --fix

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

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

```shell
git config --local core.hooksPath .githooks
```
{%- endif -%}

## Generating the API docs

Expand Down
File renamed without changes.

0 comments on commit 1d454b0

Please sign in to comment.