Skip to content

Commit

Permalink
Merge pull request #13 from datalad/convential
Browse files Browse the repository at this point in the history
Convential commits
  • Loading branch information
mih authored Jun 6, 2024
2 parents b1ca700 + be975ec commit 2649467
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Conventional commits

on: pull_request

jobs:
check-messages:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: x64
- name: Checkout
uses: actions/checkout@v4
with:
# we need all the history to be able to resolve revision ranges properly
fetch-depth: 0
- name: Install commitizen
run: python -m pip install commitizen
- name: Run commit message checks
run: |
echo cz check --rev-range ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
cz check --rev-range ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,34 @@ exclude = [
line-length = 88
indent-width = 4
target-version = "py38"

[tool.commitizen]
name = "cz_customize"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "scm"
changelog_incremental = true
template = ".changelog.md.j2"
gpg_sign = true

[tool.commitizen.customize]
commit_parser = "^((?P<change_type>feat|fix|rf|perf|test|doc|BREAKING CHANGE)(?:\\((?P<scope>[^()\r\n]*)\\)|\\()?(?P<breaking>!)?|\\w+!):\\s(?P<message>.*)?(?P<body>.*)?"
change_type_order = ["BREAKING CHANGE", "feat", "fix", "rf", "perf", "doc", "test"]
changelog_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
bump_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
schema_pattern = "(?s)(ci|doc|feat|fix|perf|rf|style|test|chore|revert|bump)(\\(\\S+\\))?!?:( [^\\n\\r]+)((\\n\\n.*)|(\\s*))?$"

[tool.commitizen.customize.bump_map]
"^\\w+!" = "MAJOR"
"^BREAKING" = "MAJOR"
"^feat" = "MINOR"
"^fix" = "PATCH"

[tool.commitizen.customize.change_type_map]
"BREAKING CHANGE" = "🪓 Breaking changes"
doc = "📝 Documentation"
feat = "💫 New features"
fix = "🐛 Bug Fixes"
test = "🛡 Tests"
rf = "🏠 Refactorings"
perf = "🚀 Performance improvements"

0 comments on commit 2649467

Please sign in to comment.