-
Notifications
You must be signed in to change notification settings - Fork 943
Closed
Labels
Description
Expected Behavior
Default setting for commentchar
is the output of git config core.commentchar
.
Current Behavior
Default setting for commentchar
is #
.
Affected packages
- cli
- core
- prompt
- config-angular
Context
Hi, thanks for this tool. The commentChar
setting appears to default to #
if not overridden explicitly:
commitlint/@commitlint/cli/src/cli.ts
Lines 224 to 229 in 1ee518c
// Strip comments if reading from `.git/COMMIT_EDIT_MSG` using the | |
// commentChar from the parser preset falling back to a `#` if that is not | |
// set | |
if (flags.edit && typeof opts.parserOpts.commentChar !== 'string') { | |
opts.parserOpts.commentChar = '#'; | |
} |
I think it would be better if it defaulted to the output of git config core.commentchar
. I know I can override it in my config, but other people might have it set to something else (I have mine set globally in ~/.gitconfig
) so not sure how I can make that work without being able to specify a global override.
This was brought up before in #2351.