Comments (10)
Did you install the commit message pre-commit hooks with pre-commit install --hook-type commit-msg
?
from cz-conventional-gitmoji.
from cz-conventional-gitmoji.
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.
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.
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.
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.
from cz-conventional-gitmoji.
@jjfantini can you check if this is fixed for you if not I'll reopen this
from cz-conventional-gitmoji.
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.
Should I try a local pre-commit-config.yaml instead of using your repo?
from cz-conventional-gitmoji.
Related Issues (8)
- QUESTION: Are you able to use gitmoji commits to bump a package? HOT 11
- [IMPROVEMENT]: Add keyboard filtering to CLI HOT 8
- Add support for chore commit type HOT 8
- [BUG]: `cz_gitmoji` doesn't support bump HOT 9
- Question: expanded list of types HOT 2
- Fix CI tests on windows
- Gitmojify pre-commit hook fails for merge commits that commitizen allows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cz-conventional-gitmoji.