Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): cleanup message for input with no config #519

Conversation

escapedcat
Copy link
Member

@escapedcat escapedcat commented Dec 12, 2018

Description

Avoid confusing duplication of result message if input and empty config.
As discussed on slack.

Usage examples

Somewhere outside of the repo try:

echo "null " | node commitlint/@commitlint/cli/lib/cli.js --config commitlint/@commitlint/cli/fixtures/empty/commitlint.config.js

Result before:

⧗   input: null
✔   found 0 problems, 0 warnings
    (Need help? -> https://github.com/marionebl/commitlint#what-is-commitlint)
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://git.io/fpUzJ
    - Example config: https://git.io/fpUzm [empty-rules]
✖   found 1 problems, 0 warnings
    (Need help? -> https://github.com/marionebl/commitlint#what-is-commitlint)

Result after:

⧗   input:
null

✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://git.io/fpUzJ
    - Example config: https://git.io/fpUzm [empty-rules]
✖   found 1 problems, 0 warnings
    (Need help? -> https://github.com/marionebl/commitlint#what-is-commitlint)

How Has This Been Tested?

Has not.

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.

@escapedcat
Copy link
Member Author

I think I need to check for the weird line-break after ⧗ input: now...

@escapedcat escapedcat changed the title fix(cli): cleanup message for input with no config WIP: fix(cli): cleanup message for input with no config Dec 12, 2018
@commitlint/cli/src/cli.js Show resolved Hide resolved
@byCedric
Copy link
Member

I think I need to check for the weird line-break after ⧗ input: now...

I think there might be something going on in the formatter itself, because the whole format is being structured in that module. Maybe we should trim this line or something like that?

this let to too many linebreaks in certain situations
@escapedcat escapedcat changed the title WIP: fix(cli): cleanup message for input with no config fix(cli): cleanup message for input with no config Dec 17, 2018
@marionebl
Copy link
Contributor

Sorry the review took me so long. LGTM!

@marionebl marionebl merged commit 7d9e760 into conventional-changelog:master Jan 27, 2019
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.

None yet

3 participants