conventional-changelog / conventional-changelog/commitlint

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

Open
#3,129 9 comments 1 reaction 0 assignees View on GitHub
bug help wanted
Dominant language
TypeScript
Stars
18.7k
Forks
970
Avg merge
7h 33m
Merged PRs (30d)
49

Description

## 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

- [x] cli
- [ ] core
- [ ] prompt
- [ ] config-angular

## Possible Solution

Display the initial input with no modification at all.

## Steps to Reproduce (for bugs)

```console
❯ echo "test(general): test

some body
related to #1

Issues: #2" | npx commitlint
```
```console
⧗ 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 |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.