Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commitlint/cli

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/cli - npm Package Compare versions

Comparing version 3.2.0 to 4.0.0

20

CHANGELOG.md
# Change Log
All notable changes to this project will be documented in this file.
See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="4.0.0"></a>
# [4.0.0](https://github.com/marionebl/commitlint/compare/v3.2.0...v4.0.0) (2017-10-04)
### Features
* enable alternative config formats ([#83](https://github.com/marionebl/commitlint/issues/83)) ([91968b8](https://github.com/marionebl/commitlint/commit/91968b8)), closes [#73](https://github.com/marionebl/commitlint/issues/73)
### BREAKING CHANGES
* discontinue support of conventional-changelog-lintrc
* test: make git setup reliable
<a name="3.2.0"></a>

@@ -7,0 +25,0 @@ # 3.2.0 (2017-09-05)

15

cli.js

@@ -26,6 +26,7 @@ #!/usr/bin/env node

const configuration = {
string: ['from', 'to', 'extends', 'parser-preset'],
string: ['cwd', 'from', 'to', 'extends', 'parser-preset'],
boolean: ['edit', 'help', 'version', 'quiet', 'color'],
alias: {
c: 'color',
d: 'cwd',
e: 'edit',

@@ -42,2 +43,3 @@ f: 'from',

color: 'toggle colored output',
cwd: 'directory to execute in',
edit: 'read last commit message found in ./git/COMMIT_EDITMSG',

@@ -48,6 +50,8 @@ extends: 'array of shareable configurations to extend',

quiet: 'toggle console output',
'parser-preset': 'configuration preset to use for conventional-commits-parser'
'parser-preset':
'configuration preset to use for conventional-commits-parser'
},
default: {
color: true,
cwd: process.cwd(),
edit: false,

@@ -73,3 +77,3 @@ from: null,

const load = seed => core.load(seed);
const load = (seed, opts) => core.load(seed, opts);

@@ -82,3 +86,3 @@ function main(options) {

const range = pick(flags, 'edit', 'from', 'to');
const input = fromStdin ? stdin() : core.read(range);
const input = fromStdin ? stdin() : core.read(range, {cwd: flags.cwd});
const fmt = new chalk.constructor({enabled: flags.color});

@@ -89,3 +93,3 @@

messages.map(commit => {
return load(getSeed(flags))
return load(getSeed(flags), {cwd: flags.cwd})
.then(loaded => {

@@ -136,3 +140,2 @@ const parserOpts = selectParserOpts(loaded.parserPreset);

function selectParserOpts(parserPreset) {

@@ -139,0 +142,0 @@ if (typeof parserPreset !== 'object') {

@@ -34,3 +34,3 @@ import path from 'path';

return result;
}
};
};

@@ -44,4 +44,8 @@

test('should throw when called without [input]', t => {
t.throws(cli()(), /Expected a raw commit/);
test('should throw when called without [input]', async t => {
const dir = tmp.dirSync().name;
await init(dir);
await t.throws(cli([], {cwd: dir})(), /Expected a raw commit/);
await rm([dir])();
});

@@ -78,7 +82,15 @@

test('should fail for input from stdin with rule from js', async t => {
const dir = tmp.dirSync().name;
await init(dir);
await sander.copydir(EXTENDS_ROOT).to(dir);
const actual = await t.throws(
cli(['--extends', './extended'], {cwd: EXTENDS_ROOT})('foo: bar')
cli(['--extends', './extended'], {cwd: dir})('foo: bar')
);
t.true(includes(actual.stdout, 'type must not be one of [foo]'));
t.is(actual.code, 1);
await rm([dir])();
});

@@ -131,7 +143,9 @@

const cwd = PARSER_PRESET;
const actual = await t.throws(cli([], {cwd})('type(scope)-ticket subject'));
const actual = await t.throws(cli([], {cwd})('type(scope)-ticket subject'));
t.true(includes(actual.stdout, 'message may not be empty [subject-empty]'));
await cli(['--parser-preset', './parser-preset'], {cwd})('type(scope)-ticket subject');
await cli(['--parser-preset', './parser-preset'], {cwd})(
'type(scope)-ticket subject'
);
});

@@ -149,3 +163,7 @@

function pkg(cwd) {
return sander.writeFile(cwd, 'package.json', JSON.stringify({scripts: {commitmsg: `${CLI} -e`}}));
return sander.writeFile(
cwd,
'package.json',
JSON.stringify({scripts: {commitmsg: `${CLI} -e`}})
);
}
{
"name": "@commitlint/cli",
"version": "3.2.0",
"version": "4.0.0",
"description": "Lint your commit messages",

@@ -56,3 +56,3 @@ "bin": {

"dependencies": {
"@commitlint/core": "^3.2.0",
"@commitlint/core": "^4.0.0",
"babel-polyfill": "^6.23.0",

@@ -59,0 +59,0 @@ "chalk": "^2.0.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc