@commitlint/is-ignored 7.5.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/lib/defaults.d.ts +3 -0
- package/lib/defaults.d.ts.map +1 -0
- package/lib/defaults.js +30 -0
- package/lib/defaults.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -18
- package/lib/index.js.map +1 -1
- package/lib/is-ignored.d.ts +7 -0
- package/lib/is-ignored.d.ts.map +1 -0
- package/lib/is-ignored.js +28 -0
- package/lib/is-ignored.js.map +1 -0
- package/package.json +10 -38
- package/lib/index.test.js +0 -94
- package/lib/index.test.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.1.0](https://github.com/conventional-changelog/commitlint/compare/v8.0.0...v8.1.0) (2019-07-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @commitlint/is-ignored
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* config based is-ignored overrides ([#595](https://github.com/conventional-changelog/commitlint/issues/595)) ([2434d71](https://github.com/conventional-changelog/commitlint/commit/2434d71))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [7.5.1](https://github.com/conventional-changelog/commitlint/compare/v7.5.0...v7.5.1) (2019-02-09)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **is-ignored:** ignore bitbuckets automatic merge ([#573](https://github.com/conventional-changelog/commitlint/issues/573)) ([e5bdc5c](https://github.com/conventional-changelog/commitlint/commit/e5bdc5c))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
<a name="7.5.0"></a>
|
|
7
37
|
# [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31)
|
|
8
38
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAEA,oBAAY,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAelD,eAAO,MAAM,SAAS,EAAE,OAAO,EAW9B,CAAC"}
|
package/lib/defaults.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
var result = {};
|
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
+
result["default"] = mod;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
exports.__esModule = true;
|
|
10
|
+
var semver = __importStar(require("semver"));
|
|
11
|
+
var isSemver = function (c) {
|
|
12
|
+
var firstLine = c.split('\n').shift();
|
|
13
|
+
if (typeof firstLine !== 'string') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var stripped = firstLine.replace(/^chore(\([^)]+\))?:/, '').trim();
|
|
17
|
+
return semver.valid(stripped) !== null;
|
|
18
|
+
};
|
|
19
|
+
var test = function (r) { return r.test.bind(r); };
|
|
20
|
+
exports.wildcards = [
|
|
21
|
+
test(/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)/m),
|
|
22
|
+
test(/^(R|r)evert (.*)/),
|
|
23
|
+
test(/^(fixup|squash)!/),
|
|
24
|
+
isSemver,
|
|
25
|
+
test(/^Merged (.*?)(in|into) (.*)/),
|
|
26
|
+
test(/^Merge remote-tracking branch (.*)/),
|
|
27
|
+
test(/^Automatic merge(.*)/),
|
|
28
|
+
test(/^Auto-merged (.*?) into (.*)/)
|
|
29
|
+
];
|
|
30
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6CAAiC;AAIjC,IAAM,QAAQ,GAAG,UAAC,CAAS;IAC1B,IAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IAExC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;QAClC,OAAO,KAAK,CAAC;KACb;IAED,IAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrE,OAAO,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AACxC,CAAC,CAAC;AAEF,IAAM,IAAI,GAAG,UAAC,CAAS,IAA+B,OAAA,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAd,CAAc,CAAC;AAExD,QAAA,SAAS,GAAc;IACnC,IAAI,CACH,mFAAmF,CACnF;IACD,IAAI,CAAC,kBAAkB,CAAC;IACxB,IAAI,CAAC,kBAAkB,CAAC;IACxB,QAAQ;IACR,IAAI,CAAC,6BAA6B,CAAC;IACnC,IAAI,CAAC,oCAAoC,CAAC;IAC1C,IAAI,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CAAC,8BAA8B,CAAC;CACpC,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = isIgnored;
|
|
7
|
-
|
|
8
|
-
var _semver = require('semver');
|
|
9
|
-
|
|
10
|
-
var _semver2 = _interopRequireDefault(_semver);
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const WILDCARDS = [c => c.match(/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)/m), c => c.match(/^(R|r)evert (.*)/), c => c.match(/^(fixup|squash)!/), c => _semver2.default.valid(c.split('\n').shift().replace(/^chore(\([^)]+\))?:/, '').trim()), c => c.match(/^Merged (.*?)(in|into) (.*)/), c => c.match(/^Merge remote-tracking branch (.*)/), c => c.match(/^Automatic merge from (.*)/), c => c.match(/^Auto-merged (.*?) into (.*)/)];
|
|
15
|
-
|
|
16
|
-
function isIgnored(commit = '') {
|
|
17
|
-
return WILDCARDS.some(w => w(commit));
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
18
4
|
}
|
|
19
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
__export(require("./is-ignored"));
|
|
20
7
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,kCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-ignored.d.ts","sourceRoot":"","sources":["../src/is-ignored.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,MAAM,GAAE,MAAW,EACnB,IAAI,GAAE,gBAAqB,GACzB,OAAO,CAqBT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
var result = {};
|
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
+
result["default"] = mod;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
exports.__esModule = true;
|
|
10
|
+
var Defaults = __importStar(require("./defaults"));
|
|
11
|
+
function isIgnored(commit, opts) {
|
|
12
|
+
if (commit === void 0) { commit = ''; }
|
|
13
|
+
if (opts === void 0) { opts = {}; }
|
|
14
|
+
var ignores = typeof opts.ignores === 'undefined' ? [] : opts.ignores;
|
|
15
|
+
if (!Array.isArray(ignores)) {
|
|
16
|
+
throw new Error("ignores must be of type array, received " + ignores + " of type " + typeof ignores);
|
|
17
|
+
}
|
|
18
|
+
var invalids = ignores.filter(function (c) { return typeof c !== 'function'; });
|
|
19
|
+
if (invalids.length > 0) {
|
|
20
|
+
throw new Error("ignores must be array of type function, received items of type: " + invalids
|
|
21
|
+
.map(function (i) { return typeof i; })
|
|
22
|
+
.join(', '));
|
|
23
|
+
}
|
|
24
|
+
var base = opts.defaults === false ? [] : Defaults.wildcards;
|
|
25
|
+
return base.concat(ignores).some(function (w) { return w(commit); });
|
|
26
|
+
}
|
|
27
|
+
exports["default"] = isIgnored;
|
|
28
|
+
//# sourceMappingURL=is-ignored.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-ignored.js","sourceRoot":"","sources":["../src/is-ignored.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuC;AAOvC,SAAwB,SAAS,CAChC,MAAmB,EACnB,IAA2B;IAD3B,uBAAA,EAAA,WAAmB;IACnB,qBAAA,EAAA,SAA2B;IAE3B,IAAM,OAAO,GAAG,OAAO,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IAExE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CACd,6CAA2C,OAAO,iBAAY,OAAO,OAAS,CAC9E,CAAC;KACF;IAED,IAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,OAAO,CAAC,KAAK,UAAU,EAAvB,CAAuB,CAAC,CAAC;IAE9D,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CACd,qEAAmE,QAAQ;aACzE,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,OAAO,CAAC,EAAR,CAAQ,CAAC;aAClB,IAAI,CAAC,IAAI,CAAG,CACd,CAAC;KACF;IAED,IAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;IAC/D,OAAW,IAAI,QAAK,OAAO,EAAE,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,EAAT,CAAS,CAAC,CAAC;AACnD,CAAC;AAxBD,+BAwBC"}
|
package/package.json
CHANGED
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/is-ignored",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Lint your commit messages",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
6
7
|
"files": [
|
|
7
8
|
"lib/"
|
|
8
9
|
],
|
|
9
10
|
"scripts": {
|
|
10
|
-
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
|
|
11
|
-
"clean": "npx rimraf lib",
|
|
12
11
|
"deps": "dep-check",
|
|
13
|
-
"pkg": "pkg-check"
|
|
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
|
-
]
|
|
12
|
+
"pkg": "pkg-check"
|
|
36
13
|
},
|
|
37
14
|
"engines": {
|
|
38
15
|
"node": ">=4"
|
|
@@ -57,18 +34,13 @@
|
|
|
57
34
|
},
|
|
58
35
|
"license": "MIT",
|
|
59
36
|
"devDependencies": {
|
|
60
|
-
"@commitlint/parse": "^
|
|
61
|
-
"@commitlint/test": "
|
|
62
|
-
"@commitlint/utils": "^
|
|
63
|
-
"ava": "0.22.0",
|
|
64
|
-
"babel-cli": "6.26.0",
|
|
65
|
-
"babel-preset-commitlint": "^7.5.0",
|
|
66
|
-
"babel-register": "6.26.0",
|
|
67
|
-
"concurrently": "3.5.1",
|
|
68
|
-
"cross-env": "5.1.1",
|
|
69
|
-
"rimraf": "2.6.1"
|
|
37
|
+
"@commitlint/parse": "^8.1.0",
|
|
38
|
+
"@commitlint/test": "8.0.0",
|
|
39
|
+
"@commitlint/utils": "^8.1.0"
|
|
70
40
|
},
|
|
71
41
|
"dependencies": {
|
|
72
|
-
"semver": "
|
|
73
|
-
|
|
42
|
+
"@types/semver": "^6.0.1",
|
|
43
|
+
"semver": "6.1.1"
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "c17420d67adafdf37f68d6861d29a0e85a4a3bd7"
|
|
74
46
|
}
|
package/lib/index.test.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _ava = require('ava');
|
|
4
|
-
|
|
5
|
-
var _ava2 = _interopRequireDefault(_ava);
|
|
6
|
-
|
|
7
|
-
var _ = require('.');
|
|
8
|
-
|
|
9
|
-
var _2 = _interopRequireDefault(_);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
const VERSION_MESSAGES = ['0.0.1', '0.1.0', '1.0.0', '0.0.1-alpha', '0.0.1-some-crazy-tag', '0.0.1-0', '0.0.1-999', '0.0.1-alpha.0', '0.0.1-alpha.999', '0.0.1-some-crazy-tag.0', '0.0.1-some-crazy-tag.999', '0.0.1-1e69d54', 'v0.0.1', ' v3.0.0'];
|
|
14
|
-
|
|
15
|
-
const AMENDMENTS = ['Signed-off-by: Developer <example@example.com>', 'Change-Id: I895114872a515a269487a683124b63303818e19c', 'Signed-off-by: Developer <example@example.com>\nChange-Id: I895114872a515a269487a683124b63303818e19c'];
|
|
16
|
-
|
|
17
|
-
const AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {
|
|
18
|
-
return [...results, ...AMENDMENTS.map(amendment => `${message}\n\n${amendment}`)];
|
|
19
|
-
}, []);
|
|
20
|
-
|
|
21
|
-
(0, _ava2.default)('should return false when called without arguments', t => {
|
|
22
|
-
t.false((0, _2.default)());
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
(0, _ava2.default)('should return false when called with empty string', t => {
|
|
26
|
-
t.false((0, _2.default)(''));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
(0, _ava2.default)('should return false for normal commit', t => {
|
|
30
|
-
t.false((0, _2.default)('initial commit'));
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
(0, _ava2.default)('should return true for branch merges', t => {
|
|
34
|
-
t.true((0, _2.default)("Merge branch 'iss53'"));
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
(0, _ava2.default)('should return true for branch merges with newline characters', t => {
|
|
38
|
-
t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\n"));
|
|
39
|
-
t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\r\n"));
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
(0, _ava2.default)('should return true for branch merges with multiple newline characters', t => {
|
|
43
|
-
t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\n\n\n"));
|
|
44
|
-
t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\r\n\r\n\r\n"));
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
(0, _ava2.default)('should return true for merged PRs', t => {
|
|
48
|
-
t.true((0, _2.default)('Merge pull request #369'));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
(0, _ava2.default)('should return true for branch merges with newline characters and more characters after it', t => {
|
|
52
|
-
t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\n "));
|
|
53
|
-
t.true((0, _2.default)("Merge branch 'ctrom-YarnBuild'\r\n # some comment"));
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
(0, _ava2.default)('should return true for revert commits', t => {
|
|
57
|
-
t.true((0, _2.default)(`Revert "docs: add recipe for linting of all commits in a PR (#36)"\n\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`));
|
|
58
|
-
t.true((0, _2.default)(`revert "docs: add recipe for linting of all commits in a PR (#36)"\n\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`));
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
(0, _ava2.default)('should ignore npm semver commits', t => {
|
|
62
|
-
VERSION_MESSAGES.forEach(message => t.true((0, _2.default)(message)));
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
(0, _ava2.default)('should ignore npm semver commits with chore', t => {
|
|
66
|
-
VERSION_MESSAGES.forEach(message => t.true((0, _2.default)(`chore: ${message}`)));
|
|
67
|
-
VERSION_MESSAGES.forEach(message => t.true((0, _2.default)(`chore(release): ${message}`)));
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
(0, _ava2.default)('should ignore npm semver commits with footers', t => {
|
|
71
|
-
AMENDED_VERSION_MESSAGES.forEach(message => t.true((0, _2.default)(message)));
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
(0, _ava2.default)('should return true fixup commits', t => {
|
|
75
|
-
t.true((0, _2.default)('fixup! initial commit'));
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
(0, _ava2.default)('should return true squash commits', t => {
|
|
79
|
-
t.true((0, _2.default)('squash! initial commit'));
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
(0, _ava2.default)('should return true for bitbucket merge commits', t => {
|
|
83
|
-
t.true((0, _2.default)('Merged in feature/facebook-friends-sync (pull request #8)'));
|
|
84
|
-
t.true((0, _2.default)('Merged develop into feature/component-form-select-card'));
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
(0, _ava2.default)('should return true for automatic merge commits', t => {
|
|
88
|
-
t.true((0, _2.default)('Auto-merged develop into master'));
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
(0, _ava2.default)('should return false for commits containing, but not starting, with merge branch', t => {
|
|
92
|
-
t.false((0, _2.default)('foo bar Merge branch xxx'));
|
|
93
|
-
});
|
|
94
|
-
//# sourceMappingURL=index.test.js.map
|
package/lib/index.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.test.js"],"names":["VERSION_MESSAGES","AMENDMENTS","AMENDED_VERSION_MESSAGES","reduce","results","message","map","amendment","t","false","true","forEach"],"mappings":"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","file":"index.test.js","sourcesContent":["import test from 'ava';\nimport isIgnored from '.';\n\nconst VERSION_MESSAGES = [\n\t'0.0.1',\n\t'0.1.0',\n\t'1.0.0',\n\t'0.0.1-alpha',\n\t'0.0.1-some-crazy-tag',\n\t'0.0.1-0',\n\t'0.0.1-999',\n\t'0.0.1-alpha.0',\n\t'0.0.1-alpha.999',\n\t'0.0.1-some-crazy-tag.0',\n\t'0.0.1-some-crazy-tag.999',\n\t'0.0.1-1e69d54',\n\t'v0.0.1',\n\t' v3.0.0'\n];\n\nconst AMENDMENTS = [\n\t'Signed-off-by: Developer <example@example.com>',\n\t'Change-Id: I895114872a515a269487a683124b63303818e19c',\n\t'Signed-off-by: Developer <example@example.com>\\nChange-Id: I895114872a515a269487a683124b63303818e19c'\n];\n\nconst AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {\n\treturn [\n\t\t...results,\n\t\t...AMENDMENTS.map(amendment => `${message}\\n\\n${amendment}`)\n\t];\n}, []);\n\ntest('should return false when called without arguments', t => {\n\tt.false(isIgnored());\n});\n\ntest('should return false when called with empty string', t => {\n\tt.false(isIgnored(''));\n});\n\ntest('should return false for normal commit', t => {\n\tt.false(isIgnored('initial commit'));\n});\n\ntest('should return true for branch merges', t => {\n\tt.true(isIgnored(\"Merge branch 'iss53'\"));\n});\n\ntest('should return true for branch merges with newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\"));\n});\n\ntest('should return true for branch merges with multiple newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\\n\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\\r\\n\\r\\n\"));\n});\n\ntest('should return true for merged PRs', t => {\n\tt.true(isIgnored('Merge pull request #369'));\n});\n\ntest('should return true for branch merges with newline characters and more characters after it', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n \"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n # some comment\"));\n});\n\ntest('should return true for revert commits', t => {\n\tt.true(\n\t\tisIgnored(\n\t\t\t`Revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n\tt.true(\n\t\tisIgnored(\n\t\t\t`revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n});\n\ntest('should ignore npm semver commits', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should ignore npm semver commits with chore', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(`chore: ${message}`)));\n\tVERSION_MESSAGES.forEach(message =>\n\t\tt.true(isIgnored(`chore(release): ${message}`))\n\t);\n});\n\ntest('should ignore npm semver commits with footers', t => {\n\tAMENDED_VERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should return true fixup commits', t => {\n\tt.true(isIgnored('fixup! initial commit'));\n});\n\ntest('should return true squash commits', t => {\n\tt.true(isIgnored('squash! initial commit'));\n});\n\ntest('should return true for bitbucket merge commits', t => {\n\tt.true(\n\t\tisIgnored('Merged in feature/facebook-friends-sync (pull request #8)')\n\t);\n\tt.true(isIgnored('Merged develop into feature/component-form-select-card'));\n});\n\ntest('should return true for automatic merge commits', t => {\n\tt.true(isIgnored('Auto-merged develop into master'));\n});\n\ntest('should return false for commits containing, but not starting, with merge branch', t => {\n\tt.false(isIgnored('foo bar Merge branch xxx'));\n});\n"]}
|