Skip to content

Commit

Permalink
feat: introduce pre-commit for all templates
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Mar 19, 2024
1 parent e3b8108 commit 1108026
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 3 deletions.
15 changes: 15 additions & 0 deletions template/cxx/.pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ --fix=lf ]
- id: trailing-whitespace
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.18.4
hooks:
- id: commitizen
2 changes: 1 addition & 1 deletion template/cxx/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Try to do one pull request per change.
### Updating the changelog

Update the changes you have made in
[CHANGELOG](https://github.com/{{gh_uname}}/{{project-name}}/blob/main/CHANGELOG.md)
[CHANGELOG](CHANGELOG.md)
file under the **Unreleased** section.

Add the changes of your pull request to one of the following subsections,
Expand Down
19 changes: 19 additions & 0 deletions template/go/.pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ --fix=lf ]
- id: trailing-whitespace
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.18.4
hooks:
- id: commitizen
- repo: https://github.com/golangci/golangci-lint
rev: v1.56.2
hooks:
- id: golangci-lint
2 changes: 1 addition & 1 deletion template/go/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Try to do one pull request per change.
### Updating the changelog

Update the changes you have made in
[CHANGELOG](https://github.com/{{gh_uname}}/{{project-name}}/blob/main/CHANGELOG.md)
[CHANGELOG](CHANGELOG.md)
file under the **Unreleased** section.

Add the changes of your pull request to one of the following subsections,
Expand Down
23 changes: 23 additions & 0 deletions template/py/.pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ --fix=lf ]
- id: trailing-whitespace
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.18.4
hooks:
- id: commitizen
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion template/py/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Try to do one pull request per change.
### Updating the changelog

Update the changes you have made in
[CHANGELOG](https://github.com/{{gh_uname}}/{{project-name}}/blob/main/CHANGELOG.md)
[CHANGELOG](CHANGELOG.md)
file under the **Unreleased** section.

Add the changes of your pull request to one of the following subsections,
Expand Down

0 comments on commit 1108026

Please sign in to comment.