Giter Club home page Giter Club logo

Comments (10)

ljnsn avatar ljnsn commented on June 12, 2024

Did you install the commit message pre-commit hooks with pre-commit install --hook-type commit-msg?

from cz-conventional-gitmoji.

jjfantini avatar jjfantini commented on June 12, 2024

from cz-conventional-gitmoji.

ljnsn avatar ljnsn commented on June 12, 2024

Your config looks fine. Could you make a minimal reproducible example repo or describe exactly your workflow?

This works for example:

poetry new foo
cd foo
git init
poetry add pre-commit
# add your cz config to pyproject.toml
# add your pre-commit config
pre-commit install --install-hooks  --hook-type commit-msg
git add .
git commit -m "init: initial version"
# commit message: 🎉 init: initial commit

from cz-conventional-gitmoji.

jjfantini avatar jjfantini commented on June 12, 2024

Yes, I am working in this repo. Feel free to take a look! Again, I really appreciate the help.

After running pre-commit install, my hooks get messed up and ruff executable can't be found

from cz-conventional-gitmoji.

jjfantini avatar jjfantini commented on June 12, 2024

I have tried doing what you suggested:

Command failed with exit code 1: git commit -m "feat: test"
gitmojify................................................................Failed
- hook id: conventional-gitmoji
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\jjfan\.cache\pre-commit\repo_zkw_ns5\py_env-python3\Scripts\gitmojify.EXE\__main__.py", line 7, in <module>
  File "C:\Users\jjfan\.cache\pre-commit\repo_zkw_ns5\py_env-python3\Lib\site-packages\gitmojify\mojify.py", line 57, in run
    f.write(gitmojify(msg))
  File "C:\Users\jjfan\github\gitmoji-test\menv\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u2728' in position 0: character maps to <undefined>

I am using poetry and micromamba to manage my environments.

from cz-conventional-gitmoji.

ljnsn avatar ljnsn commented on June 12, 2024

After running pre-commit install, my hooks get messed up and ruff executable can't be found

The ruff executable missing is something else, for me your repo works just fine (after adding the config you posted above to pre-commit-config, it doesn't seem to be there on the dev/gitmojify branch).

The issue seems to be that windows on writing the file uses latin1 encoding and thus cannot encode the unicode character that is assigned to the gitmoji. Do you get the same error if you run gitmojify -m "fix: foo" on cli?

I'll try to reproduce this and make a fix.

from cz-conventional-gitmoji.

jjfantini avatar jjfantini commented on June 12, 2024

from cz-conventional-gitmoji.

ljnsn avatar ljnsn commented on June 12, 2024

@jjfantini can you check if this is fixed for you if not I'll reopen this

from cz-conventional-gitmoji.

jjfantini avatar jjfantini commented on June 12, 2024

Issue Description:

Experiencing difficulties with getting emojis to appear in the repository. No errors are observed, but emojis are not visible in the expected locations.

Branch Reference:

Working on the dev/no_cz_customize branch. Below are the branch settings:

[tool.commitizen]
name = "cz_gitmoji"
version = "0.8.0"
tag_format = "v$version"
update_changelog_on_bump = true
annotated_tag = true
bump_message = "🔖 bump(release): v$current_version → v$new_version"
version_files = ["pyproject.toml:^version"]

===========================================
# https://pre-commit.com
default_install_hook_types: [commit-msg, pre-commit]
default_stages: [commit, manual]
fail_fast: true
repos:
  - repo: https://github.com/ljnsn/cz-conventional-gitmoji
    rev: v0.2.0
    hooks:
      - id: conventional-gitmoji

Testing Results

Commit Method Successful Gitmojify Hook Successful Version Bump
Commitizen commit Not appending emoji ✅ Bumping commit message (without emoji)
CLI cz commit ➖ N.A (commit has emoji already) commit ✅ Bumping commit message (with emoji)
CLI lazygit Not appending emoji ✅ Bumping commit message (without emoji)
VSCode Source Control Text Input Not appending emoji ✅ Bumping commit message (without emoji)

from cz-conventional-gitmoji.

jjfantini avatar jjfantini commented on June 12, 2024

Should I try a local pre-commit-config.yaml instead of using your repo?

from cz-conventional-gitmoji.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.