Skip to content

Commit 98d11aa

Browse files
committed
Merge branch 'master' into feat-cli-config-resolver
2 parents b18a16e + 8ae0b23 commit 98d11aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+545
-1376
lines changed

@alias/commitlint-config-lerna-scopes/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
<a name="5.2.6"></a>
7+
## [5.2.6](https://github.com/marionebl/commitlint/compare/v5.2.5...v5.2.6) (2017-12-21)
8+
9+
10+
11+
12+
**Note:** Version bump only for package commitlint-config-lerna-scopes
13+
614
<a name="5.2.0"></a>
715
# [5.2.0](https://github.com/marionebl/commitlint/compare/v5.1.3...v5.2.0) (2017-11-30)
816

@alias/commitlint-config-lerna-scopes/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commitlint-config-lerna-scopes",
3-
"version": "5.2.0",
3+
"version": "5.2.6",
44
"description": "Shareable commitlint config enforcing lerna package names as scopes",
55
"scripts": {
66
"test": "exit 0",
@@ -24,6 +24,6 @@
2424
},
2525
"homepage": "https://github.com/marionebl/commitlint#readme",
2626
"dependencies": {
27-
"@commitlint/config-lerna-scopes": "^5.2.0"
27+
"@commitlint/config-lerna-scopes": "^5.2.6"
2828
}
2929
}

@alias/commitlint/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,38 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
<a name="5.2.6"></a>
7+
## [5.2.6](https://github.com/marionebl/commitlint/compare/v5.2.5...v5.2.6) (2017-12-21)
8+
9+
10+
11+
12+
**Note:** Version bump only for package commitlint
13+
14+
<a name="5.2.5"></a>
15+
## [5.2.5](https://github.com/marionebl/commitlint/compare/v5.2.4...v5.2.5) (2017-12-08)
16+
17+
18+
19+
20+
**Note:** Version bump only for package commitlint
21+
22+
<a name="5.2.4"></a>
23+
## [5.2.4](https://github.com/marionebl/commitlint/compare/v5.2.3...v5.2.4) (2017-12-08)
24+
25+
26+
27+
28+
**Note:** Version bump only for package commitlint
29+
30+
<a name="5.2.3"></a>
31+
## [5.2.3](https://github.com/marionebl/commitlint/compare/v5.2.2...v5.2.3) (2017-12-05)
32+
33+
34+
35+
36+
**Note:** Version bump only for package commitlint
37+
638
<a name="5.2.0"></a>
739
# [5.2.0](https://github.com/marionebl/commitlint/compare/v5.1.3...v5.2.0) (2017-11-30)
840

@alias/commitlint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commitlint",
3-
"version": "5.2.0",
3+
"version": "5.2.6",
44
"description": "Lint your commit messages",
55
"bin": {
66
"commitlint": "cli.js"
@@ -28,7 +28,7 @@
2828
},
2929
"license": "MIT",
3030
"dependencies": {
31-
"@commitlint/cli": "^5.2.0",
31+
"@commitlint/cli": "^5.2.6",
3232
"read-pkg": "3.0.0",
3333
"resolve-pkg": "1.0.0"
3434
}

@commitlint/cli/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,41 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
<a name="5.2.6"></a>
7+
## [5.2.6](https://github.com/marionebl/commitlint/compare/v5.2.5...v5.2.6) (2017-12-21)
8+
9+
10+
11+
12+
**Note:** Version bump only for package @commitlint/cli
13+
14+
<a name="5.2.5"></a>
15+
## [5.2.5](https://github.com/marionebl/commitlint/compare/v5.2.4...v5.2.5) (2017-12-08)
16+
17+
18+
19+
20+
**Note:** Version bump only for package @commitlint/cli
21+
22+
<a name="5.2.4"></a>
23+
## [5.2.4](https://github.com/marionebl/commitlint/compare/v5.2.3...v5.2.4) (2017-12-08)
24+
25+
26+
27+
28+
**Note:** Version bump only for package @commitlint/cli
29+
30+
<a name="5.2.3"></a>
31+
## [5.2.3](https://github.com/marionebl/commitlint/compare/v5.2.2...v5.2.3) (2017-12-05)
32+
33+
34+
### Bug Fixes
35+
36+
* **cli:** add support for GIT_PARAMS on windows ([c62bd41](https://github.com/marionebl/commitlint/commit/c62bd41)), closes [#103](https://github.com/marionebl/commitlint/issues/103) [#175](https://github.com/marionebl/commitlint/issues/175)
37+
38+
39+
40+
641
<a name="5.2.0"></a>
742
# [5.2.0](https://github.com/marionebl/commitlint/compare/v5.1.3...v5.2.0) (2017-11-30)
843

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
rules: {
3+
'signed-off-by': [2, 'always', 'Signed-off-by']
4+
}
5+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"scripts": {},
3+
"devDependencies": {
4+
"husky": "0.14.3"
5+
}
6+
}

@commitlint/cli/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@commitlint/cli",
3-
"version": "5.2.0",
3+
"version": "5.2.6",
44
"description": "Lint your commit messages",
55
"bin": {
66
"commitlint": "./lib/cli.js"
@@ -50,15 +50,15 @@
5050
},
5151
"license": "MIT",
5252
"devDependencies": {
53-
"@commitlint/test": "^5.2.0",
53+
"@commitlint/test": "^5.2.6",
5454
"@commitlint/utils": "^5.1.1",
5555
"ava": "0.18.2",
5656
"babel-cli": "6.26.0",
5757
"babel-preset-commitlint": "^5.2.0",
5858
"babel-register": "6.26.0",
5959
"concurrently": "3.5.1",
6060
"cross-env": "5.1.1",
61-
"dependency-check": "2.9.1",
61+
"dependency-check": "2.9.2",
6262
"execa": "0.8.0",
6363
"mkdirp": "0.5.1",
6464
"resolve-bin": "0.4.0",
@@ -69,7 +69,7 @@
6969
"xo": "0.18.2"
7070
},
7171
"dependencies": {
72-
"@commitlint/core": "^5.2.0",
72+
"@commitlint/core": "^5.2.6",
7373
"babel-polyfill": "6.26.0",
7474
"babel-runtime": "^6.26.0",
7575
"chalk": "2.3.0",

@commitlint/cli/src/cli.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,21 @@ function normalizeFlags(raw) {
134134
merge(flags, {edit: true, e: true});
135135
}
136136

137+
// The recommended method to specify -e with husky is commitlint -e $GIT_PARAMS
138+
// This does not work properly with win32 systems, where env variable declarations
139+
// use a different syntax
140+
// See https://github.com/marionebl/commitlint/issues/103 for details
141+
if (flags.edit === '$GIT_PARAMS' || flags.edit === '%GIT_PARAMS%') {
142+
if (!('GIT_PARAMS' in process.env)) {
143+
throw new Error(
144+
`Received ${
145+
flags.edit
146+
} as value for -e | --edit, but GIT_PARAMS is not available globally.`
147+
);
148+
}
149+
return process.env.GIT_PARAMS;
150+
}
151+
137152
if (!('format' in flags)) {
138153
flags.format = 'commitlint';
139154
}

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ test('should work with husky commitmsg hook in sub packages', async () => {
171171
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
172172
});
173173

174+
test('should work with husky via commitlint -e $GIT_PARAMS', async () => {
175+
const cwd = await git.bootstrap('fixtures/husky/integration');
176+
await writePkg({scripts: {commitmsg: `${bin} -e $GIT_PARAMS`}}, {cwd});
177+
178+
await execa('npm', ['install'], {cwd});
179+
await execa('git', ['add', 'package.json'], {cwd});
180+
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
181+
});
182+
183+
test('should work with husky via commitlint -e %GIT_PARAMS%', async () => {
184+
const cwd = await git.bootstrap('fixtures/husky/integration');
185+
await writePkg({scripts: {commitmsg: `${bin} -e %GIT_PARAMS%`}}, {cwd});
186+
187+
await execa('npm', ['install'], {cwd});
188+
await execa('git', ['add', 'package.json'], {cwd});
189+
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
190+
});
191+
174192
test('should pick up parser preset and fail accordingly', async t => {
175193
const cwd = await git.bootstrap('fixtures/parser-preset');
176194
const actual = await cli(['--parser-preset', './parser-preset'], {cwd})(
@@ -220,6 +238,20 @@ test('should pick up config from inside git repo with precedence and fail accord
220238
t.is(actual.code, 1);
221239
});
222240

241+
test('should handle --amend with signoff', async () => {
242+
const cwd = await git.bootstrap('fixtures/signoff');
243+
await writePkg({scripts: {commitmsg: `${bin} -e`}}, {cwd});
244+
245+
await execa('npm', ['install'], {cwd});
246+
await execa('git', ['add', 'package.json'], {cwd});
247+
await execa(
248+
'git',
249+
['commit', '-m', '"test: this should work"', '--signoff'],
250+
{cwd}
251+
);
252+
await execa('git', ['commit', '--amend', '--no-edit'], {cwd});
253+
});
254+
223255
async function writePkg(payload, options) {
224256
const pkgPath = path.join(options.cwd, 'package.json');
225257
const pkg = JSON.parse(await sander.readFile(pkgPath));

0 commit comments

Comments
 (0)