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

commitizen check failed using the "cz-conventional-gitmoji" #1141

Open
atiasn opened this issue May 23, 2024 · 2 comments
Open

commitizen check failed using the "cz-conventional-gitmoji" #1141

atiasn opened this issue May 23, 2024 · 2 comments

Comments

@atiasn
Copy link

atiasn commented May 23, 2024

Description

commitizen check failed using the "cz-conventional-gitmoji"

Steps to reproduce

  1. conda create virtualenv
  2. conda activate the virtualenv
  3. poetry add commitizen
  4. poetry add cz-conventional-gitmoji
  5. edit .pre-commit-config.yaml
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v3.27.0
    hooks:
      - id: commitizen
        stages: [commit-msg]
  1. edit pyproject.toml
[tool.commitizen]
name = "cz_gitmoji"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "poetry"
update_changelog_on_bump = true
major_version_zero = true
version_files = ["pyproject.toml:^version"]
bump_message = "🔖 bump(release): $current_version → $new_version"
  1. poetry show
# poetry show | grep commi
commitizen              3.27.0      Python commitizen client tool
cz-conventional-gitmoji 0.3.2       A commitizen plugin that combines gitmo...

Current behavior

commitizen check.........................................................Failed
- hook id: commitizen
- exit code: 1

The committer has not been found in the system.

Try running 'pip install cz_gitmoji'
# which cz
/home/clei/miniconda3/envs/paimon/bin/cz
                         
Python 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.import_module("cz_gitmoji")
<module 'cz_gitmoji' from '/home/clei/miniconda3/envs/paimon/lib/python3.11/site-packages/cz_gitmoji/__init__.py'>

Desired behavior

The "commitizen check" should be passed

Screenshots

No response

Environment

# cz version --report
Commitizen Version: 3.27.0
Python Version: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0]
Operating System: Linux
@Lee-W
Copy link
Member

Lee-W commented May 28, 2024

AFAIK, pre-commit setup a new env for each hook so you'll need to set "additional_dependencies", but this is indeed something we can improve in the documentation

@atiasn
Copy link
Author

atiasn commented May 28, 2024

@Lee-W Thanks, I set the additional_dependencies in the .pre-commit-config.yaml and it ran successfully.

repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
  - id: commitizen
    stages: [commit-msg]
    additional_dependencies: ["cz-conventional-gitmoji"]

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