question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

input is not displayed correctly (non-existing blank lines added)

See original GitHub issue

Current Behavior

When there’s no blank line between body and footer (and the line is recognised as footer due to existing issue reference), commitlint wrongly displays the input and adds that blank line between them, which makes the lint messages pretty confusing (please look at the example below).

Expected Behavior

Displayed input should be exactly the same as provided input.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Display the initial input with no modification at all.

Steps to Reproduce (for bugs)

❯ echo "test(general): test

some body
related to #1

Issues: #2" | npx commitlint
⧗   input: test(general): test

some body

related to #1

Issues: #2
✖   footer must have leading blank line [footer-leading-blank]

(looking at what is displayed - the blank line is there, but it’s actually missing)

Context

Your Environment

Executable Version
commitlint --version @commitlint/cli@16.2.3
git --version git version 2.32.0 (Apple Git-132)
node --version v17.9.0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wthocommented, Apr 20, 2022

@jaklan Yes, #896 is purely about the implementation in footer-leading-blank.ts, although a better parsing might help with that issue as well.

1reaction
jaklancommented, Apr 20, 2022

@escapedcat

#3120 is about some issue with footer-leading-blank rule logic used to calculate if there’s blank line before footer or not, so imho it’s completely not related.

#896 is about parsing - when we provide:

test: footer-leading-blank bug

hello
see issue #1234

we get:

  body: 'hello',
  footer: 'see issue #1234',

and for:

fix: correct minor typos in code

see the issue for details

on typos fixed.

Reviewed-by: Z
Refs #133

we get:

  body: 'see the issue for details\n\non typos fixed.\n\nReviewed-by: Z',
  footer: 'Refs #133',

So in general - that’s a problem with parser not being able to properly identify what is body, and what is footer. So also not related to the above one, but to conventional-commits-parser, and affects not the input display, but the execution of defined rules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing blank lines from a textarea's output - php
I'm using PHP. I dont mind using a regexp or anything else. Incorrect Data Matthew Mark Luke John James. Correct Data (Note blank...
Read more >
outreg2 - RePEc
A blank line can be inserted by including "" as a note. ... specifies user-added text (including numbers) to be displayed in new...
Read more >
Fix list for IBM Integration Bus Version 10.0
TOOLKIT INCORRECTLY DISPLAYS EXECUTIONS GROUPS AS UP/DOWN WHEN THEY ARE RESTRICTED. IT22890, USER NODE DEFINED SIMULATOR DOES NOT DISPLAY THE LARGE ICON.
Read more >
How to use grep command in Linux/ Unix with examples
Display 4 lines after dropped word matched in firewall log file # ... If there is process named tiger (output of grep is...
Read more >
Add a field to a form or report - Microsoft Support
If the Field List pane is not displayed, do one of the following: On the Design tab, in the Tools group, click Add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found