conventional-changelog / commitlint

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

fix/feat!: show input from a new line #4112

Open abitrolly opened 3 months ago

abitrolly commented 3 months ago

Proposal to discuss

It will be less confusing to read, and also easier to test and copy/paste (for example for #4101) if the error message of commitlint tool contained exact input.

This is a breaking change, but it should be, and the arguments are:

  1. new format makes user readable error message also machine readable
  2. the output can be copy/pasted for tests
  3. the new text is not confusing for potential 100k+ of new users
  4. 100k+ users spending 5 minutes trying to understand what is the error, who produced that, and what exactly is the source, is a lot of time better spent on fixing other stuff
  5. integration of linters with tools and editors should use JSON or other standard machine readable format, so that no ANSI codes or fixes in grammar break them again

Current Behavior

This error log is confusing for people not familiar with commitlint.

⧗   input: fix: ingest - do not double strip /doc/ prefix
It is already stripped here
https://gitlab.com/gitlab-community/modelops/applied-ml/code-suggestions/ai-assist/-/blob/22bb9cf2b996dc2ec347bad761abb12fd11bcf75/scripts/ingest/gitlab-docs/steps/parse.rb#L16
✖   body's lines must not be longer than 100 characters [body-max-line-length]
✖   found 1 warnings

Expected Behavior

⧗ commit 4c6319af message:
fix: ingest - do not double strip /doc/ prefix

It is already stripped here
https://gitlab.com/gitlab-community/modelops/applied-ml/code-suggestions/ai-assist/-/blob/22bb9cf2b996dc2ec347bad761abb12fd11bcf75/scripts/ingest/gitlab-docs/steps/parse.rb#L16
✖   body's lines must not be longer than 100 characters [body-max-line-length]
✖   found 1 warnings

Affected packages

Possible Solution

No response

Context

No response

commitlint --version

latest

git --version

latest

node --version

latest

knocte commented 3 months ago

I agree with @abitrolly's change.