commitizen / commitizen/cz-cli

Inconsistent spacing around emojis when displayed in terminal

Abierto
#815 2 comentarios 5 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
17.5k
Forks
566
Merge medio
8 h 16 min
PR fusionados (30 d)
1

Descripción

## Issue

When I use Emojis in my **.cz-config.js** file to customize my commit messages, I see inconsistent spacing around specific Emojis. This is happening in both my VS Code terminal and my Mac OS terminal. I originally had issues with Emojis displaying correctly in VS Code files (you can see that issue [here](https://github.com/microsoft/vscode/issues/118905)), but I believe this spacing issue stems from `commitizen` since it's happening outside of my VS Code.

Check out my **.cz-config.js** file at the end of this issue so that you can see how the Emojis are being used for my commit messages. **You will see that after every Emoji I have just 1 space between the Emoji and the next text.**

No space shown after ⚙️ `:gear:` and ♻️ `:recycle:` Emojis:
Screen Shot 2021-03-20 at 5 12 07 PM

No space shown after ⬇️ `:arrow_down:` and 🛠️ `:hammer_and_wrench:` Emojis:
Screen Shot 2021-03-20 at 5 13 22 PM

No space shown after ✔️ `:heavy_check_mark:`, ✏️ `:pencil2:`, and ⬆️ `:arrow_up:` Emojis:
Screen Shot 2021-03-20 at 5 16 35 PM

No space shown after 🏷️ `:label:` Emoji:
Screen Shot 2021-03-20 at 5 17 53 PM

No space shown after 🖥️ `:desktop_computer:` Emoji:
Screen Shot 2021-03-20 at 5 19 04 PM

### The issue IS resolved when 2 spaces are added after Emojis, but I feel like this is a hacky fix and shouldn't be necessary

## Project Information
This occurs in multiple projects. Each project I use this same setup:
- VS Code version 1.54.3
- **package.json** `devDependencies`:
- `"@commitlint/cli": "^12.0.1"`
- `"@commitlint/config-conventional": "^12.0.1"`
- `"commitizen": "^4.2.3"`
- `"cz-customizable": "^6.3.0"`
- This `config` is also in my **package.json**:
```
"config": {
"commitizen": {
"path": "./node_modules/cz-customizable"
}
},
```
- My **.commitlintrc.js**: `module.exports = { extends: ['@commitlint/config-conventional'] };
`

My .cz-config.js

```
module.exports = {
types: [
{
value: 'chore',
name: 'chore: ⚙️ Build process or supporting tool changes',
},
{
value: 'ci',
name: 'ci: 🚀 CI-related changes',
},
{
value: 'docs',
name: 'docs: 📚 Documentation updates',
},
{
value: 'feat',
name: 'feat: ⭐ Adds functionality',
},
{
value: 'fix',
name: 'fix: 🐞 Fixes a bug',
},
{
value: 'perf',
name: 'perf: ⚡️ Changes that improve performance',
},
{
value: 'refactor',
name: 'refactor: ♻️ Neither fixes a bug nor adds functionality',
},
{
value: 'release',
name: 'release: 🔖 Releases a new version',
},
{
value: 'setup',
name: 'setup: 🎉 Initial setup',
},
{
value: 'style',
name: 'style: 🎨 Adds or updates styles',
},
{
value: 'test',
name: 'test: 🧪 Adds or updates tests',
},
{
value: 'ux',
name: 'ux: 🚸 Changes that improve user experience',
},
],
scopes: [
{
value: 'wip',
name: 'wip: 🚧 WIP',
},
{
value: 'review',
name: 'review: 💯 Code review changes',
},
],
allowTicketNumber: false,
scopeOverrides: {
chore: [
{
value: 'add-dep',
name: 'add-dep: ➕ Adds dependencies',
},
{
value: 'analytics',
name: 'analytics: 📈 Adds or updates analytics',
},
{
value: 'config',
name: 'config: 🛠️ Adds or updates configuration files',
},
{
value: 'downgrade',
name: 'downgrade: ⬇️ Downgrades dependencies',
},
{
value: 'errors',
name: 'errors: 🥅 Changes that improve error handling',
},
{
value: 'ignore',
name: 'ignore: 🙈 Adds or updates .*ignore files',
},
{
value: 'merge',
name: 'merge: 🔀 Merge branches',
},
{
value: 'pin-dep',
name: 'pin-dep: 📌 Pins dependencies to specific versions',
},
{
value: 'rem-dep',
name: 'rem-dep: ➖ Removes dependencies',
},
{
value: 'scripts',
name: 'scripts: 📜 Adds or updates development scripts',
},
{
value: 'security',
name: 'security: 🔒 Security-related changes',
},
{
value: 'upgrade',
name: 'upgrade: ⬆️ Upgrades dependencies',
},
],
docs: [
{
value: 'config',
name: 'config: 🛠️ Adds or updates configuration documentation',
},
{
value: 'logs',
name: 'logs: 🔊 Adds or updates logs',
},
{
value: 'meta',
name: 'meta: 📖 Adds or updates metadata',
},
],
fix: [
{
value: 'downgrade',
name: 'downgrade: ⬇️ Downgrades dependencies',
},
{
value: 'merge',
name: 'merge: 🔀 Merge branches',
},
{
value: 'quick',
name: 'quick: 🚑 Temporarily resolves a critical bug',
},
{
value: 'revert',
name: 'revert: 🦔 Rolls back to a previous version',
},
{
value: 'style',
name: 'style: 🎨 Fixes styles',
},
{
value: 'test',
name: 'test: ✔️ Fixes tests',
},
{
value: 'typo',
name: 'typo: ✏️ Fixes typos',
},
{
value: 'upgrade',
name: 'upgrade: ⬆️ Upgrades dependencies',
},
{
value: 'warn',
name: 'warn: 🚨 Fixes compiler and/or 👕 linter warnings',
},
],
refactor: [
{
value: 'abstract',
name:
'abstract: 〰️ Changes that simplify code through abstraction',
},
{
value: 'move',
name: 'move: 🚚 Moves files',
},
{
value: 'prune',
name: 'prune: 🔥 Removes code and/or files',
},
{
value: 'read',
name: 'read: 💡 Changes that improve code readability',
},
{
value: 'rename',
name: 'rename: 🏷️ Renames files',
},
{
value: 'reuse',
name:
'reuse: ➰ Changes that implement or improve code reuse',
},
],
setup: [
{
value: 'config',
name: 'config: 🛠️ Adds or updates configuration files',
},
{
value: 'docs',
name: 'docs: 📚 Documentation updates',
},
{
value: 'init',
name: 'init: 💃 Initial commit',
},
{
value: 'move',
name: 'move: 🚚 Moves files',
},
{
value: 'prune',
name: 'prune: 🔥 Removes code and/or files',
},
{
value: 'rename',
name: 'rename: 🏷️ Renames files',
},
],
test: [
{
value: 'e2e',
name: 'e2e: 🎢 Adds or updates end-to-end tests',
},
{
value: 'perf',
name: 'perf: ⚡️ Adds or updates performance tests',
},
{
value: 'unit',
name: 'unit: 🚦 Adds or updates unit tests',
},
],
ux: [
{
value: 'access',
name: 'access: ♿️ Changes that improve user accessibility',
},
{
value: 'alt-text',
name: 'alt-text: 💬 Adds or updates alternative text',
},
{
value: 'android',
name: 'android: 🤖 Android-specific changes',
},
{
value: 'animation',
name:
'animation: ✨ Adds or updates animations and transitions',
},
{
value: 'ios',
name: 'ios: 📱 iOS-specific changes',
},
{
value: 'linux',
name: 'linux: 🐧 Linux-specific changes',
},
{
value: 'osx',
name: 'osx: 🍎 OSX-specific changes',
},
{
value: 'responsive',
name:
'responsive: 📲 Changes that affect overall responsive design',
},
{
value: 'style',
name: 'style: 🎨 Adds or updates styles',
},
{
value: 'ui',
name: 'ui: 🖥️ General UI-related changes',
},
{
value: 'windows',
name: 'windows: 🏁 Windows-specific changes',
},
],
},
messages: {
type: "Select the type of change that you're committing:",
scope: 'Select the scope of this change (optional):',
customScope: 'Denote the scope of this change:',
subject: 'Write a short description describing this change:\n',
confirmCommit:
'Are you sure you want to proceed with the commit above?',
},
allowCustomScopes: true,
skipQuestions: ['body', 'breaking', 'footer'],
subjectLimit: 100,
};
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.