Skip to content

Commit

Permalink
chore: Start using semantic versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
asgeirrr committed Nov 24, 2023
1 parent 49ea81b commit d58d2d4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@ repos:
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: local
hooks:
- id: commitizen-branch
name: commitizen conditionally check branch
description: >
Commitizen fails when there are no new commits. To overcome this, we created
tiny wrapper that verifies there are commits to check.
Original description from Commitizen:
Check all commit messages that are already on the current branch but not the
default branch on the origin repository. Useful for checking messages after
the fact (e.g., pre-push or in CI) without an expensive check of the entire
repository history.
entry: ./conditional-commitizen.sh
always_run: true
language: python
minimum_pre_commit_version: "1.4.3"
additional_dependencies: [
'commitizen',
]
3 changes: 3 additions & 0 deletions conditional-commitizen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
log=$(git log origin/HEAD..HEAD | wc -l)
if [ "$log" -gt 0 ]; then cz check --rev-range origin/HEAD..HEAD; fi

0 comments on commit d58d2d4

Please sign in to comment.