commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

feat!: show input: from a new line

Open abitrolly opened this issue 1 year ago • 7 comments

This will be less confusing to read, and also easier to test and copy/paste (for example for #4101).

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

This one should be more clear.

â§—   --- 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

Or maybe even this one.

â§—   commit 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

Motivation and Context

Error output should not mess up original commit message, because it is hard to understand what is wrong.

Usage examples

// commitlint.config.js
module.exports = {};
echo "your commit message here" | commitlint # fails/passes

How Has This Been Tested?

Types of changes

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

Checklist:

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

abitrolly avatar Jul 20 '24 19:07 abitrolly

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.

codesandbox-ci[bot] avatar Jul 20 '24 19:07 codesandbox-ci[bot]

Thanks! I understand that this might be a bit confusing for first time users but this is not a common issue we get. So I would rather close this. It doesn't justify a breaking change.

escapedcat avatar Jul 22 '24 08:07 escapedcat

@escapedcat this was confusing for 16k users who starred this and will be confusing for a 100k+ more who just don't know what GitHub is. If the confusion if just 5 minutes, it is still worth the output breaking change for me.

For integration with editors and stuff, I guess commitlint provides a proper machine readable output instead of this.

abitrolly avatar Jul 23 '24 06:07 abitrolly

Thanks for your feedback. Might be good to open up an issue for this to discuss this further and get some feedback from others. Try searching if we maybe have similiar issues already. Thanks!

escapedcat avatar Jul 23 '24 07:07 escapedcat

@escapedcat why this issue is not suitable to discuss it?

abitrolly avatar Aug 02 '24 05:08 abitrolly

@escapedcat why this issue is not suitable to discuss it?

Hm, no, it is, but I would prefer you open up an official issue for this to get some feedback/input from other users.

escapedcat avatar Aug 02 '24 06:08 escapedcat

@escapedcat created https://github.com/conventional-changelog/commitlint/issues/4112

abitrolly avatar Aug 03 '24 17:08 abitrolly