-
Notifications
You must be signed in to change notification settings - Fork 934
cz commitlint CLI question customization for custom rules. #2684
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
Comments
I had the same issue. With the help of this comment I was able to fix it by adding a rule for each header correspondence. Otherwise it was just being ignored. So I ended up with something similar to this:
Hope it helps! |
Could you share full commitlint.config.js ? Thanks! |
I searched and found this nice tutorial. I believe this may work with some tweaks |
Which tutorial? |
@escapedcat 😂 I forgot to paste it . Here it is I find it too much configurations which didn't work for me The second one here seems a bit interesting as it uses emojis too with no problems. |
I also added a "husky": "^8.0.0",
"@commitlint/cli": "^17.0.2",
"commitizen": "^4.2.4",
"commitlint-config-gitmoji": "^2.2.5",
"cz-customizable": "^6.3.0", My prepare-commit-msg hook#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
exec < /dev/tty && node_modules/.bin/cz --hook || true
🛠⚒ WARNING 🛠⚒
"cm": "cz"
// or
"commit": "cz" My pre-commit hook#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no-install commitlint --edit "$1"
My cz-config.jsmodule.exports = {
types: [
{ value: ':sparkles: feat', name: '✨ feat:\tAdding a new feature' },
{ value: ':bug: fix', name: '🐛 fix:\tFixing a bug' },
{ value: ':memo: docs', name: '📝 docs:\tAdd or update documentation' },
{
value: ':lipstick: style',
name: '💄 style:\tAdd or update styles, ui or ux',
},
{
value: ':recycle: refactor',
name: '♻️ refactor:\tCode change that neither fixes a bug nor adds a feature',
},
{
value: ':zap: perf',
name: '⚡️ perf:\tCode change that improves performance',
},
{
value: ':white_check_mark: test',
name: '✅ test:\tAdding tests cases',
},
{
value: ':truck: chore',
name: '🚚 chore:\tChanges to the build process or auxiliary tools\n\t\tand libraries such as documentation generation',
},
{ value: ':rewind: revert', name: '⏪️ revert:\tRevert to a commit' },
{ value: ':construction: wip', name: '🚧 wip:\tWork in progress' },
{
value: ':construction_worker: build',
name: '👷 build:\tAdd or update regards to build process',
},
{
value: ':green_heart: ci',
name: '💚 ci:\tAdd or update regards to build process',
},
],
scopes: [
{ name: 'ui' },
{ name: 'android' },
{ name: 'ios' },
{ name: 'home' },
{ name: 'planner' },
{ name: 'settings' },
],
scopeOverrides: {
fix: [{ name: 'merge' }, { name: 'style' }, { name: 'test' }, { name: 'hotfix' }],
},
allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix'],
// skip any questions you want
skipQuestions: ['body'],
subjectLimit: 100,
}; My commitlint.config.jsmodule.exports = {
extends: ['gitmoji'],
rules: {
'header-max-length': [0, 'always', 100],
},
}; My Package.json config part "config": {
"commitizen": {
"path": "cz-customizable"
}
}, |
I wanna make something similar like this feat: TEAMCVSPB-(any number) - (message). I created regexp like this /^(\w*): (TEAMCVSPB-\d+) ([a-zA-Z])+$/g, but it can't parse it I got this in my log
my config looks like this
What I'm doing wrong guys please help me ? @chrwlk @tomavic @gsmith-mythical |
I'm not able to have a prompt for a custom rule. (e.g. ticket number included in commit message). commitlint-cli: 18.4.3 |
I would like to add the ability to add a CLI prompt for a custom rule. (e.g. ticket number included in commit message)
Expected Behavior
Would like for a way to add new custom option to add ticket number to the CLI prompt.
feat(button): added theme settings [TICKET-123]
commitlint.config.js
parser-preset.js
Current Behavior
Currently ignores my new rule / custom CLI prompt. I can't find any documentation that directly walks through this process of making a custom prompt with a custom rule. You can override current rules and change language. But unable to have question use new custom made rules. If this isn't something that can be / is supported that's perfectly fine! I'm just curious if it's currently possible, and if it is where I may be tripping up.
Affected packages
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: