You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
~~Link commits in changelog~~ add plugin_path option to enable loading local plugins #396
Add the ability to link a changelog message to the original commit. This would greatly increase the ability to provide context around changes.
Possible Solution
Ability to add a changelog option, so when generating a changelog, it would just add links in the generated markdown for the associated commit message.
After #396 (comment), we decide adding a plugin_path might be a good solution for it.
I don't think it makes sense to add links, because if we add github link any other git server (gitlab, bitbucket, etc) would have to have something similar.
Thanks for the response! Although I think I'm a bit confused how I would add the above function you mentioned to a python configuration file alongside my project. The docs seem to imply I need an entirely separate package/github repo? That seems a bit excessive for a small project-specific configuration change.
As of now the changelog provides some flexibility.
Extra functionality like sending slack messages, customizing what is shown in the changelog, like emojis, github links, etc are considered out of the scope of the flexibility we can provide.
You could create a new custom changelog with the github commits and list it in the third party section, we have a template (which needs some love :/)
I think the design could be improved, but we don't have the capacity at the moment, sorry for that.
Then I think this issue also relates to #264 (comment). We'll need to make cz configurable first. It's on our plan but we're quite busy these days. Not sure when could we support this feature
I think I'm a bit confused. I'm talking about having a configuration option in your pyproject.toml called plugin_path that would point to a local plugin file so users could easily implement their own project-specific plugins without having to create a whole new package on PYPI.
@Lee-W could you point me towards the relevant code/steps needed to add a new configuration option? If you guys are keen on adding this as a feature, that is.
commitizen/config/init.py is the file that we use to manage the configuration. But I think we might not need to change it, unless the configuration is complicated.
commitizen/cz/init.py is where we load these cz rules. I think this one might be more relevant.
changed the title [-]Link commits in changelog[/-][+]~~Link commits in changelog~~ add `plugin_path` option to enable loading local plugins[/+]on Aug 14, 2022
Activity
woile commentedon Jul 1, 2021
Hello! This can be achieved using a custom hook.
https://commitizen-tools.github.io/commitizen/customization.html#custom-changelog-generator
You can use
changelog_message_builder_hookIn the example you can see the commit author is being added to each commit, the same can be done for commits:
I don't think it makes sense to add links, because if we add github link any other git server (gitlab, bitbucket, etc) would have to have something similar.
jtpavlock commentedon Jul 6, 2021
Thanks for the response! Although I think I'm a bit confused how I would add the above function you mentioned to a python configuration file alongside my project. The docs seem to imply I need an entirely separate package/github repo? That seems a bit excessive for a small project-specific configuration change.
Lee-W commentedon Jul 7, 2021
Yes, I think that's the only way as of now.
woile commentedon Jul 7, 2021
As of now the changelog provides some flexibility.
Extra functionality like sending slack messages, customizing what is shown in the changelog, like emojis, github links, etc are considered out of the scope of the flexibility we can provide.
You could create a new custom changelog with the github commits and list it in the third party section, we have a template (which needs some love :/)
I think the design could be improved, but we don't have the capacity at the moment, sorry for that.
jtpavlock commentedon Jul 12, 2021
Could adding a config setting pointing to a python file work?
The following code is a snippet that can be used to import a module from a given
plugin_pathfilenamesource: https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
Maybe then
plugin_modulecould be added to the list of plugins that you import normally?Lee-W commentedon Jul 14, 2021
Does that mean we'll need to add a
plugin_pathconfiguration?This is how we load
cz_as of nowhttps://github.com/commitizen-tools/commitizen/blob/master/commitizen/cz/__init__.py
jtpavlock commentedon Jul 14, 2021
Yes, that's correct.
Lee-W commentedon Jul 15, 2021
Then I think this issue also relates to #264 (comment). We'll need to make cz configurable first. It's on our plan but we're quite busy these days. Not sure when could we support this feature
jtpavlock commentedon Jul 15, 2021
I think I'm a bit confused. I'm talking about having a configuration option in your
pyproject.tomlcalledplugin_paththat would point to a local plugin file so users could easily implement their own project-specific plugins without having to create a whole new package on PYPI.Lee-W commentedon Jul 16, 2021
After a second thought, I was wrong about the idea. Yep, I think we could add this option. @woile What do you think?
jtpavlock commentedon Aug 2, 2021
@Lee-W could you point me towards the relevant code/steps needed to add a new configuration option? If you guys are keen on adding this as a feature, that is.
Lee-W commentedon Aug 3, 2021
commitizen/config/init.py is the file that we use to manage the configuration. But I think we might not need to change it, unless the configuration is complicated.
commitizen/cz/init.py is where we load these cz rules. I think this one might be more relevant.
usrme commentedon Jun 10, 2022
Example on how to add a custom Python module: #395 (comment).
[-]Link commits in changelog[/-][+]~~Link commits in changelog~~ add `plugin_path` option to enable loading local plugins[/+]