Skip to content

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

Open
@AtticusZeller

Description

@AtticusZeller

Description

hey there👋 it's a fantastic cil tools. thanks for your guys contribution!

it's impossible to cover the default options such as commit Patten via toml after checking the docs and raw code,only will work on complicated full customization in toml which is scary.
😭

the following is the version i would like to use:

[tool.commitizen]
name = "cz_conventional_commits"
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|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"}

of course,[tool.commitizen.customize] would be invalid because of [tool.commitizen] name is not cz_customize according to the docs and raw code.

it looks like we coverd cz_conventional_commits version with [tool.commitizen.customize],which is what we need.

so let's replace the name as cz_customize, it will work on cz bump --dry-run,but cz commit -a would failed for no complete definition [tool.commitizen.customize],also docs had given the complete one looks terrified.

Possible Solution

i think we can realize it via making class CustomizeCommitsCz:to inherit from ConventionalCommitsCz directly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions