commitizen-tools / commitizen

Create committing rules for projects :rocket: auto bump versions :arrow_up: and auto changelog generation :open_file_folder:
https://commitizen-tools.github.io/commitizen/
MIT License
2.55k stars 266 forks source link

feat(customize.py/test_cz_customize.py): inherit from ConventionalCom… #1273

Closed AtticusZeller closed 1 month ago

AtticusZeller commented 1 month ago

enable cz_customize default behavior follow ConventionalCommitsCz without trivial settings

Description

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

Checklist

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

codecov[bot] commented 1 month ago

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 :warning:
Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/commitizen-tools/commitizen/pull/1273/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/commitizen-tools/commitizen/pull/1273/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `97.48% <80.00%> (+0.14%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

AtticusZeller commented 1 month ago

switch correct branch