conventional-changelog / commitlint

📓 Lint commit messages
https://commitlint.js.org
MIT License
16.92k stars 912 forks source link

fix: subject-case value set to lower-case but input is not properly formatted (prompt-cli) #3570

Open leungk712 opened 1 year ago

leungk712 commented 1 year ago

Expected Behavior

Setting subject-case value to lower-case should properly format all text to lower-case. If it moves onto the next step without properly formatting, an error should properly display.

Current Behavior

  1. When I type my subject message in all uppercase, the cli shows it being lower-cased, but when I go to the next step, the subject still displays as all upper-case
  2. There is no error that pops up that my text is not lower-case

commitlint_cli

Affected packages

Possible Solution

No response

Steps to Reproduce

1. Set subject-case rule in `commitlint.config.js`

module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'subject-case': [2, 'always', 'lower-case'],
  },
};

2. When committing, I type HELLO WORLD as my subject and move to the next stage (body), no error prompt appears that my text is not lower-case. The commit message is currently generated as `fix: HELLO WORLD` instead of `fix: hello world`

Context

No response

commitlint --version

@commitlint/cli: ^17.4.2

git --version

v2.25.1

node --version

v16.14.2

escapedcat commented 1 year ago

Is this using prompt or commitizen or...?

leungk712 commented 1 year ago

Is this using prompt or commitizen or...?

Hi, this is using prompt-cli @commitlint/prompt-cli": "^17.4.2"

escapedcat commented 1 year ago

Alright, thanks. Yeah, prompt is not in a good state anymore. If you want to have a look how to fix this give it a try. Otherwise have a look the commitizen adapter.

leungk712 commented 1 year ago

Ok, thank you for confirming. When I have time on the side I would like to take a look and try to fix this.

I'm assuming it'd be inside the @commitlint/parse or parse-cli directory?

Thanks for the work on this package.

escapedcat commented 1 year ago

Also have a look at prompt-cli and prompt maybe.