Skip to content

Commit 8fbd4fe

Browse files
committed
Revert "fix: avoid excessive help text #606 (#637)"
This reverts commit 8f3c3b1.
1 parent 435f006 commit 8fbd4fe

15 files changed

+352
-2234
lines changed

@commitlint/cli/src/cli.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ const flags = {
8989
alias: 'v',
9090
type: 'boolean',
9191
description: 'display version information'
92-
},
93-
verbose: {
94-
alias: 'V',
95-
type: 'boolean',
96-
description: 'enable verbose output for reports without problems'
9792
}
9893
};
9994

@@ -209,14 +204,9 @@ async function main(options) {
209204
}
210205
);
211206

212-
const output = format(report, {
213-
color: flags.color,
214-
verbose: flags.verbose,
215-
helpUrl:
216-
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
217-
});
207+
const output = format(report, {color: flags.color});
218208

219-
if (!flags.quiet && output !== '') {
209+
if (!flags.quiet) {
220210
console.log(output);
221211
}
222212

@commitlint/cli/src/cli.test.js

+4-29
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,20 @@ test('should reprint input from stdin', async t => {
3232
t.true(actual.stdout.includes('foo: bar'));
3333
});
3434

35-
test('should produce success output with --verbose flag', async t => {
36-
const cwd = await git.bootstrap('fixtures/default');
37-
const actual = await cli(['--verbose'], {cwd})('type: bar');
38-
t.true(actual.stdout.includes('0 problems, 0 warnings'));
39-
t.is(actual.stderr, '');
40-
});
41-
42-
test('should produce no output with --quiet flag', async t => {
35+
test('should produce no success output with --quiet flag', async t => {
4336
const cwd = await git.bootstrap('fixtures/default');
4437
const actual = await cli(['--quiet'], {cwd})('foo: bar');
4538
t.is(actual.stdout, '');
4639
t.is(actual.stderr, '');
4740
});
4841

49-
test('should produce no output with -q flag', async t => {
42+
test('should produce no success output with -q flag', async t => {
5043
const cwd = await git.bootstrap('fixtures/default');
5144
const actual = await cli(['-q'], {cwd})('foo: bar');
5245
t.is(actual.stdout, '');
5346
t.is(actual.stderr, '');
5447
});
5548

56-
test('should produce help for empty config', async t => {
57-
const cwd = await git.bootstrap('fixtures/empty');
58-
const actual = await cli([], {cwd})('foo: bar');
59-
t.true(actual.stdout.includes('Please add rules'));
60-
t.is(actual.code, 1);
61-
});
62-
63-
test('should produce help for problems', async t => {
64-
const cwd = await git.bootstrap('fixtures/default');
65-
const actual = await cli([], {cwd})('foo: bar');
66-
t.true(
67-
actual.stdout.includes(
68-
'Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
69-
)
70-
);
71-
t.is(actual.code, 1);
72-
});
73-
7449
test('should fail for input from stdin without rules', async t => {
7550
const cwd = await git.bootstrap('fixtures/empty');
7651
const actual = await cli([], {cwd})('foo: bar');
@@ -284,13 +259,13 @@ test('should print full commit message when input from stdin fails', async t =>
284259
t.is(actual.code, 1);
285260
});
286261

287-
test('should not print commit message fully or partially when input succeeds', async t => {
262+
test('should not print full commit message when input succeeds', async t => {
288263
const cwd = await git.bootstrap('fixtures/default');
289264
const message = 'type: bar\n\nFoo bar bizz buzz.\n\nCloses #123.';
290265
const actual = await cli([], {cwd})(message);
291266

292267
t.false(actual.stdout.includes(message));
293-
t.false(actual.stdout.includes(message.split('\n')[0]));
268+
t.true(actual.stdout.includes(message.split('\n')[0]));
294269
t.is(actual.code, 0);
295270
});
296271

@commitlint/format/index.d.ts

-1
This file was deleted.

@commitlint/format/index.js

-1
This file was deleted.

@commitlint/format/jest.config.js

-4
This file was deleted.

@commitlint/format/package.json

+30-10
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,32 @@
77
"lib/"
88
],
99
"scripts": {
10-
"build": "tsc",
10+
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
1111
"clean": "npx rimraf lib",
1212
"deps": "dep-check",
1313
"pkg": "pkg-check --skip-import",
14-
"start": "concurrently \"yarn test --watchAll\" \"yarn run watch\"",
15-
"test": "jest",
16-
"watch": "tsc -w"
14+
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
15+
"test": "ava -c 4 --verbose",
16+
"watch": "babel src --out-dir lib --watch --source-maps"
17+
},
18+
"ava": {
19+
"files": [
20+
"src/**/*.test.js",
21+
"!lib/**/*"
22+
],
23+
"source": [
24+
"src/**/*.js",
25+
"!lib/**/*"
26+
],
27+
"babel": "inherit",
28+
"require": [
29+
"babel-register"
30+
]
31+
},
32+
"babel": {
33+
"presets": [
34+
"babel-preset-commitlint"
35+
]
1736
},
1837
"engines": {
1938
"node": ">=4"
@@ -40,16 +59,17 @@
4059
"devDependencies": {
4160
"@commitlint/test": "7.5.0",
4261
"@commitlint/utils": "^7.5.0",
43-
"@types/jest": "24.0.12",
44-
"@types/lodash": "4.14.123",
62+
"ava": "0.22.0",
63+
"babel-cli": "6.26.0",
64+
"babel-preset-commitlint": "^7.5.0",
65+
"babel-register": "6.26.0",
4566
"concurrently": "3.5.1",
4667
"cross-env": "5.1.1",
47-
"jest": "24.7.1",
48-
"rimraf": "2.6.1",
49-
"ts-jest": "24.0.2",
50-
"typescript": "3.4.5"
68+
"lodash": "4.17.11",
69+
"rimraf": "2.6.1"
5170
},
5271
"dependencies": {
72+
"babel-runtime": "^6.23.0",
5373
"chalk": "^2.0.1"
5474
}
5575
}

0 commit comments

Comments
 (0)