Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default bump_message for plugin #938

Open
ghisvail opened this issue Dec 17, 2023 · 2 comments
Open

Change default bump_message for plugin #938

ghisvail opened this issue Dec 17, 2023 · 2 comments
Labels
issue-status: wait-for-implementation maintainers agree on the bug / feature type: feature A new enhacement proposal

Comments

@ghisvail
Copy link

Description

I designed a Commitizen plugin and would like to implement a restriction on bump commits.

So far, I know I can use:

# pyproject.toml

[tool.commitizen]
name = "cz_pydata"
bump_message = "REL: Release version $new_version"

But it would be up to individual projects to explicitly override bump_message to get cz bump --changelog to produce a bump message compliant with the PyData spec.

Possible Solution

Instead, I would like to set this template as default for cz_pydata so that configuring the project with:

# pyproject.toml

[tool.commitizen]
name = "cz_pydata"

and running cz bump --changelog would produce a commit formatted as REL: Release version $new_version.

Even better if bump_message remains overridable for projects using additional markers like [skip ci].

Additional context

No response

Additional context

No response

@ghisvail
Copy link
Author

I tried the following (based on how default_style_config works), but it did not work:

class PydataCz(BaseCommitizen):

    default_bump_message = "REL: Release version $new_version"

    def __init__(self, config: BaseConfig):
        super().__init__(config)

        if not self.config.settings.get("bump_message"):
            self.config.update({"bump_message": PydataCz.default_bump_message})

@Lee-W
Copy link
Member

Lee-W commented May 20, 2024

Hi @ghisvail , thanks for reporting this. I just traced the code a bit. This is not doable as of now, and I think this is a valid enhancement we can have. Would you like to create a PR and make this enhancement?

@Lee-W Lee-W added issue-status: wait-for-implementation maintainers agree on the bug / feature type: feature A new enhacement proposal and removed issue-status: needs-triage labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue-status: wait-for-implementation maintainers agree on the bug / feature type: feature A new enhacement proposal
Projects
None yet
Development

No branches or pull requests

2 participants