Skip to content

feat(cz-commitlint): support customizable commit prompt with emojis#4540

Merged
escapedcat merged 2 commits intoconventional-changelog:masterfrom
parloti:master
Oct 3, 2025
Merged

feat(cz-commitlint): support customizable commit prompt with emojis#4540
escapedcat merged 2 commits intoconventional-changelog:masterfrom
parloti:master

Conversation

@parloti
Copy link
Copy Markdown
Contributor

@parloti parloti commented Aug 26, 2025

Description

This PR adds customizable emojis to the Commitlint prompt. This allows users to define richer, more informative options for commit types, which enhances the user experience and provides better context during the commit process.

Motivation and Context

The previous prompt was limited to displaying simple, text-based commit types. There was no way to add visual cues like emojis or descriptive text directly within the prompt's options, which made it less intuitive for developers. This change addresses that limitation.

TODO emoji + title
#3618
#4534

Usage examples

The documentation was updated with examples.

How Has This Been Tested?

Extensive tests were added to confirm that the enumList is formatted correctly, alignment is handled properly, and the emojiInHeader option functions as expected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codesandbox-ci
Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@parloti
Copy link
Copy Markdown
Contributor Author

parloti commented Aug 26, 2025

Hey guys, tabs like I mentioned here don't work well.
Each terminal handles emojis differently; if you correct them for one, they break in another. So using single spaces allows the user to customize them to their needs.

I only have Windows 11 here, on other systems you may have different behaviors.

Default configuration

vs code
vs-code

git-bash
git-bash

cmd
cmd

power shell
power_shell

Adding space to force alignment in vs code

example

vs code
vs-code

git-bash
git-bash

cmd
cmd

power shell
power-shell

@parloti
Copy link
Copy Markdown
Contributor Author

parloti commented Aug 26, 2025

@ViniDevBR I think a PR with an example with gitmoji in the documentation would be welcome.

@ViniDevBR
Copy link
Copy Markdown

@ViniDevBR I think a PR with an example with gitmoji in the documentation would be welcome.

Nice. but i think that them will not accept this PR because of the space in powershell. But lets wait for this.
If not approve we can just remove the icon from CLI and just add this in the final message.

About the documentation...
I created one in other issue or PR that you was with me

import { UserConfig } from "@commitlint/types";
import gitmoji from 'commitlint-config-gitmoji'

/**
 * @type {import('@commitlint/types').UserConfig}
 */
module.exports = {
  extends: ['@commitlint/config-conventional'],
  prompt: {
    questions: {
      type: {
        description: "Select the type of change that you're committing",
        enum: {
          feat: {
            description: "A new feature",
            title: "Features",
            emoji: "✨",
          },
          fix: {
            description: "A bug fix",
            title: "Bug Fixes",
            emoji: "🐛",
          },
          docs: {
            description: "Documentation only changes",
            title: "Documentation",
            emoji: "📚",
          },
          style: {
            description:
              "Changes that do not affect the meaning of the code (linters)",
            title: "Styles",
            emoji: "🎨",
          },
          refactor: {
            description:
              "A code change that neither fixes a bug nor adds a feature",
            title: "Code Refactoring",
            emoji: "📦",
          },
          perf: {
            description: "A code change that improves performance",
            title: "Performance Improvements",
            emoji: "🚀",
          },
          test: {
            description: "Adding missing tests or correcting existing tests",
            title: "Tests",
            emoji: "🚨",
          },
          build: {
            description:
              "Changes that affect the build system or external dependencies (yarn)",
            title: "Builds",
            emoji: "🏗️ ",
          },
          ci: {
            description:
              "Changes to our CI configuration files and scripts (GitActions)",
            title: "Continuous Integrations",
            emoji: "⚙️ ",
          },
          chore: {
            description: "Other changes that don't modify src or test files",
            title: "Chores",
            emoji: "♻️ ",
          },
          revert: {
            description: "Reverts a previous commit",
            title: "Reverts",
            emoji: "⏪",
          },
        },
      },
    },
  },
  parserPreset: {
    parserOpts: gitmoji.parserPreset.parserOpts,
    plugins: [gitmoji.parserPreset.plugins],
  },
  ...gitmoji.rules,
  ...gitmoji.plugins
} as UserConfig

@escapedcat
Copy link
Copy Markdown
Member

Sorry, @parloti are we good here?

@parloti
Copy link
Copy Markdown
Contributor Author

parloti commented Oct 3, 2025

@escapedcat We are! Everything's set on my end, and the PR is ready to be merged whenever you get a chance.

@escapedcat escapedcat merged commit 803c05b into conventional-changelog:master Oct 3, 2025
12 checks passed
immxmmi pushed a commit to immxmmi/gitea-helm-actions that referenced this pull request Apr 20, 2026
This PR contains the following updates:

| Package | Type | Update | Change | Age | Confidence |
|---|---|---|---|---|---|
| [commitlint/commitlint](https://github.com/conventional-changelog/commitlint) | container | minor | `20.1.0` -> `20.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/docker/commitlint%2fcommitlint/20.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/commitlint%2fcommitlint/20.1.0/20.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [docker.io/thegeeklab/git-sv](https://github.com/thegeeklab/git-sv) | container | patch | `2.0.8` -> `2.0.9` | [![age](https://developer.mend.io/api/mc/badges/age/docker/docker.io%2fthegeeklab%2fgit-sv/2.0.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/docker.io%2fthegeeklab%2fgit-sv/2.0.8/2.0.9?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) | devDependencies | minor | [`^0.46.0` -> `^0.47.0`](https://renovatebot.com/diffs/npm/markdownlint-cli/0.46.0/0.47.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/markdownlint-cli/0.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/markdownlint-cli/0.46.0/0.47.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>conventional-changelog/commitlint (commitlint/commitlint)</summary>

### [`v20.2.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2020-2025-12-05)

[Compare Source](conventional-changelog/commitlint@v20.1.0...v20.2.0)

##### Bug Fixes

- update dependency glob to v11 \[security] ([#&#8203;4561](conventional-changelog/commitlint#4561)) ([a89a08b](conventional-changelog/commitlint@a89a08b))

##### Features

- **cz-commitlint:** support customizable commit prompt with emojis ([#&#8203;4540](conventional-changelog/commitlint#4540)) ([803c05b](conventional-changelog/commitlint@803c05b))
- **lint:** update ESLint configuration to use Vitest and remove Jest plugin ([#&#8203;4542](conventional-changelog/commitlint#4542)) ([63e7ad4](conventional-changelog/commitlint@63e7ad4))
- **rules:** add breaking-change-exclamation-mark ([#&#8203;4548](conventional-changelog/commitlint#4548)) ([c4d419b](conventional-changelog/commitlint@c4d419b)), closes [#&#8203;4547](conventional-changelog/commitlint#4547)

</details>

<details>
<summary>thegeeklab/git-sv (docker.io/thegeeklab/git-sv)</summary>

### [`v2.0.9`](https://github.com/thegeeklab/git-sv/releases/tag/v2.0.9)

[Compare Source](thegeeklab/git-sv@v2.0.8...v2.0.9)

#### v2.0.9 (2025-12-05)

##### Others

- **deps:** update docker.io/library/alpine docker tag to v3.23 ([#&#8203;260](thegeeklab/git-sv#260)) ([`2f6207a`](thegeeklab/git-sv@2f6207a))
- **deps:** update golang patch version ([#&#8203;261](thegeeklab/git-sv#261)) ([`a4cc5da`](thegeeklab/git-sv@a4cc5da))

</details>

<details>
<summary>igorshubovych/markdownlint-cli (markdownlint-cli)</summary>

### [`v0.47.0`](https://github.com/igorshubovych/markdownlint-cli/releases/tag/v0.47.0)

[Compare Source](igorshubovych/markdownlint-cli@v0.46.0...v0.47.0)

- Add output and exit code support for warnings
- Update `markdownlint` dependency to `0.40.0`
  - Improve `MD011`/`MD013`/`MD051`/`MD060`
- Update all dependencies via `Dependabot`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xOC4xIiwidXBkYXRlZEluVmVyIjoiNDEuMTguMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsia2luZC9kZXBlbmRlbmN5Il19-->

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/88
Reviewed-by: DaanSelen <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants