Skip to content

Expect newlines in output after linting commit messagesΒ #504

Closed
@hsxfjames

Description

When I try to merge more than two branches, commitlint will print its output before git's diff info. Then git will continue to print its output but without a newline.

Current Behavior

β–Ά git merge dev_name_A dev_name_B
Fast-forwarding to: dev_name_A
Trying simple merge with dev_name_B
Simple merge did not work, trying automatic merge.
Auto-merging package-lock.json
Auto-merging package.json
husky > commit-msg (node v10.12.0)

β§—   input: Merge branches 'dev_name_A' and 'dev_name_B' into dev_name_C
βœ”   found 0 problems, 0 warningsMerge made by the 'octopus' strategy.
 build/prod.js                                                         |   2 +-

 ...any other diff info

Expected Behavior

β§—   input: Merge branches 'dev_name_A' and 'dev_name_B' into dev_name_C
βœ”   found 0 problems, 0 warnings

Merge made by the 'octopus' strategy.
 build/prod.js                                                         |   2 +-

 ...any other diff info

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Print additional newlines after printing commitlint's output.

Steps to Reproduce (for bugs)

  1. Create three git chunks.
  2. Merge two of those chunks into another chunk.
commitlint.config.js
module.exports = {
    extends: ['@commitlint/config-conventional'],
    rules: {
        'scope-empty': [2, 'never'],
        'scope-enum': [2, 'always', [
            'scope-A',
            'scope-B',
        ]],
        'subject-empty': [2, 'never'],
        'subject-case': [0, 'never'],
    },
};

Context

Your Environment

Executable Version
commitlint --version 7.2.1
git --version 2.19.2
node --version v10.12.0
Others Version
husky 1.2.0
os macOS Mojave 10.14.1

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions