-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
custom committer plugin not found when using cz check via git hook #453
Comments
I have this clue (perhaps)
so basically when my plugin imports the base class it ends up importing the default inits of commitizen which end up requiering the plugin and since it wasn't loaded yet - fail, basicaly it's a circular dependency p |
I think I found the cause, it related to this ros/rosdistro#18116 - the use of _ (underscopes) in pip package names, when I use pip list it shows me I have cz-algotec (with hypen) and that's why it can't find it ???? still reseaching, some help would be appriciated, has anyone managed to use custom rules at all?? |
no, not related to the above, I see that in your code you use |
Hi @nadavsinai-philips , how do you install commitizen itself? is it in the same env as your local plugin? |
Update: I spoke too soon. I re-read the above comments and the reported error isn't an issue at all with dashes or underscores (#453 (comment)) |
(FYI I corrected my previous post. You're likely right about the circular import issue. I had a similar problem reported in #474) In case this is helpful, I use my custom plugin - repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.3
hooks:
- id: commitizen
# yamllint disable-line rule:line-length
additional_dependencies:
[
"git+https://github.com/KyleKing/cz_legacy.git@bfff2ab4134c26a31f1e7f9c3a8d4bedba824b08",
]
stages: [commit-msg] |
thanks @KyleKing , I ditched commitizen for now and moved to use commitlint |
Description
I wrote a custom plugin to enforce our desired commit message template, it works fine when I invoke cz check but when I call cz check via the git commit hook it fails
my githook is written in python and invoked via shebang, I tried adding an install via pip to the custom plugin package (locally avilable0 but it doesn't help. I verified the package is found when using pip list and also it works when I invoke cz check from the command line
I don't know what's the difference from the hook invocation (calling sub_process.run - with shell:True)
Steps to reproduce
commit-msg
scriptCurrent behavior
fail to run the custom logic
Desired behavior
custom logic runs,
Environment
cz version 2.20.0
Python Version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Operating System: Windows
The text was updated successfully, but these errors were encountered: