Skip to content

feat!: show input from a new line#4102

Closed
abitrolly wants to merge 2 commits into
conventional-changelog:masterfrom
abitrolly:patch-1
Closed

feat!: show input from a new line#4102
abitrolly wants to merge 2 commits into
conventional-changelog:masterfrom
abitrolly:patch-1

Conversation

@abitrolly

@abitrolly abitrolly commented Jul 20, 2024

Copy link
Copy Markdown
Contributor

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)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

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

This will be less confusing to read, and also easier to test
and copy/paste..
@codesandbox-ci

codesandbox-ci Bot commented Jul 20, 2024

Copy link
Copy Markdown

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.

@escapedcat

Copy link
Copy Markdown
Member

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.

@abitrolly

Copy link
Copy Markdown
Contributor Author

@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.

@escapedcat

Copy link
Copy Markdown
Member

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!

@abitrolly

Copy link
Copy Markdown
Contributor Author

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

@escapedcat

Copy link
Copy Markdown
Member

@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.

@abitrolly

Copy link
Copy Markdown
Contributor Author

@escapedcat created #4112

@escapedcat escapedcat changed the title feat!: show input: from a new line feat!: show input from a new line Mar 19, 2026
@escapedcat escapedcat requested a review from Copilot March 19, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates @commitlint/format’s displayed “input” so the commit message starts on a new line, improving readability and copy/paste ergonomics (notably for multi-line messages with URLs as in #4101).

Changes:

  • Change formatted output from ⧗ input: <message> to a two-line banner ⧗ --- input --- followed by the raw commit message on the next line.
  • Update the corresponding @commitlint/format unit test expectation for verbose output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
@commitlint/format/src/format.ts Adjusts the formatted “input” header to include a banner + newline before the commit message.
@commitlint/format/src/format.test.ts Updates the verbose-mode snapshot/expectation to match the new banner output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


return options.verbose || hasProblems
? [`${decoration} input: ${decoratedInput}`]
? [`${decoration} --- input ---\n${decoratedInput}`]
'⧗ --- input ---\nfeat(cli): this is a valid header\n\nThis is a valid body\n\nSigned-off-by: tester\n✔ found 0 problems, 0 warnings'
);
});

@abitrolly

Copy link
Copy Markdown
Contributor Author

@Copilot can you change --- input --- to commit 4c6319af message:?

@knocte

knocte commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

@Copilot can you change --- input --- to commit 4c6319af message:?

Hey, not sure why copilot is not acting on these requests, maybe it needs maintainer to comment, not just a contributor?

Anyway, if you could address the feedback from it? There are two comments which include easy suggestions that can just be applied by pressing a button.

@escapedcat

Copy link
Copy Markdown
Member

If this is being continued please make this optional with default true so people can turn it off if needed. Maybe in the future we can deprecate the option and make it default. Let's see.

@knocte knocte mentioned this pull request Apr 22, 2026
7 tasks
@escapedcat

Copy link
Copy Markdown
Member

Eventually will be done in here: #4727

@escapedcat escapedcat closed this Apr 25, 2026
@abitrolly

Copy link
Copy Markdown
Contributor Author

@escapedcat I turned "Allow edits by maintainers" on, so that you can reopen and edit this PR if needed.

Chances that I am going back to restore dev environment and figure out how to make it optional are minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants