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

changelog_hook not called when "--dry-run" is passed #620

Open
c0dearm opened this issue Nov 23, 2022 · 2 comments
Open

changelog_hook not called when "--dry-run" is passed #620

c0dearm opened this issue Nov 23, 2022 · 2 comments

Comments

@c0dearm
Copy link

c0dearm commented Nov 23, 2022

Description

I am trying to modify the default changelog created by Commitizen to add a few links at the end of it. For that, I saw in the documentation I could use the changelog_hook in my custom class: https://commitizen-tools.github.io/commitizen/customization/#custom-changelog-generator

Apparently though, that hook is never called by Commitizen, so it is rather usless. From a quick search in the code, I can see its only appearance is the declaration in the BaseCommitizen class.

Steps to reproduce

  1. Create a custom class inheriting from BaseCommitizen
  2. Write the changelog_hook method and do something visible.
  3. Set up your project configuration so that your custom class is used by Commitizen
  4. Commit something and perform a cz bump --changelog --dry-run
  5. Check how the changelog remains being the default.

Current behavior

Nothing happens and the changelog remains the same.

Desired behavior

The changelog_hook should be called and the outputted changelog should have the changes that were applied in the method.

Screenshots

No response

Environment

Commitizen Version: 2.37.0
Python Version: 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0]
Operating System: Linux
@c0dearm
Copy link
Author

c0dearm commented Nov 23, 2022

After some more investigation I saw it is actually called, but only when generating the real changelog file, not during dry-runs. Probably it should work with dry-runs too.

@Lee-W Lee-W changed the title changelog_hook not used at all? changelog_hook not called when "--dry-run" is passed Dec 3, 2022
@Lee-W
Copy link
Member

Lee-W commented Dec 3, 2022

Hi @c0dearm , thanks for reporting! I just change the description to enhance the readability of this issue

@noirbizarre noirbizarre mentioned this issue Apr 24, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants