Skip to content

Conversation

@AtticusZeller
Copy link

enable cz_customize default behavior follow ConventionalCommitsCz without trivial settings

Description

try to Enable cover cz_conventional_commits via [tool.commitizen.customize] #1270

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

[tool.commitizen]
name = "cz_customize"
tag_format = "$version"
version_scheme = "semver"
version_provider = "pep621"
update_changelog_on_bump = true
major_version_zero = true
changelog_incremental = false

[tool.commitizen.customize]
commit_parser = "^((?P<change_type>feat|fix|refactor|perf|docs|style|refactor|ci|BREAKING CHANGE)(?:\\((?P<scope>[^()\r\n]*)\\)|\\()?(?P<breaking>!)?|\\w+!):\\s(?P<message>.*)?"
changelog_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
change_type_map = {"feat"="Feat","fix"="Fix","refactor"= "Refactor","perf"="Perf","docs"="Docs","style"="Style","ci"="CI"}

now [tool.commitizen.customize] will cover the ConventionalCommitsCz settings

Steps to Test This Pull Request

  1. add example [tool.commitizen.customize] into your pyproject.toml
  2. cz commit -a,select docs,cz ch --dry-run,docs item will appear in your CHANGELOG.md

here is my test-repo

…mitsCz directly

enable cz_customize default behavior follow ConventionalCommitsCz without trivial settings
@codecov
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 97.48%. Comparing base (120d514) to head (dda73ba).
Report is 465 commits behind head on master.

Files with missing lines Patch % Lines
commitizen/cz/customize/customize.py 80.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1273      +/-   ##
==========================================
+ Coverage   97.33%   97.48%   +0.14%     
==========================================
  Files          42       55      +13     
  Lines        2104     2585     +481     
==========================================
+ Hits         2048     2520     +472     
- Misses         56       65       +9     
Flag Coverage Δ
unittests 97.48% <80.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AtticusZeller
Copy link
Author

switch correct branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant