Skip to content

refactor(commitlint): simplify commitlint alias package #965

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

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Feb 6, 2020

Simplify commitlint alias package and add tests for it

Description

Motivation and Context

Remove unnecessary dependencies

Usage examples

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.


require(bin);
const pkgDir = require('@commitlint/cli');
require(pkgDir);
Copy link
Contributor Author

@armano2 armano2 Feb 6, 2020

Choose a reason for hiding this comment

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

this can be even simpler as we can directly import

require('@commitlint/cli/lib/cli');

Copy link
Contributor

Choose a reason for hiding this comment

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

Good call on the simplification. Let's keep the current solution to maintain a degree of decoupling so we can move around the the commitlint bin file inside of @commitlint/cli if we want to.

const actual = await cli(['--verbose'], {cwd}, 'type: bar');
expect(actual.stdout).toContain('0 problems, 0 warnings');
expect(actual.stderr).toEqual('');
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm unsure if we really need tests for this

Copy link
Contributor

Choose a reason for hiding this comment

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

Quick smoke tests are in order via #889

@marionebl marionebl merged commit 96e81a5 into conventional-changelog:master Feb 6, 2020
@armano2 armano2 deleted the alias-commitlint branch February 6, 2020 21:52
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.

2 participants