@commitlint/is-ignored 7.3.0 → 7.6.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 CHANGED
@@ -3,8 +3,49 @@
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
+ # [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * config based is-ignored overrides ([#595](https://github.com/conventional-changelog/commitlint/issues/595)) ([2434d71](https://github.com/conventional-changelog/commitlint/commit/2434d71))
12
+
13
+
14
+
15
+
16
+
17
+ ## [7.5.1](https://github.com/conventional-changelog/commitlint/compare/v7.5.0...v7.5.1) (2019-02-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **is-ignored:** ignore bitbuckets automatic merge ([#573](https://github.com/conventional-changelog/commitlint/issues/573)) ([e5bdc5c](https://github.com/conventional-changelog/commitlint/commit/e5bdc5c))
23
+
24
+
25
+
26
+
27
+
28
+ <a name="7.5.0"></a>
29
+ # [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * replace all repository references with conventional changelog ([#561](https://github.com/conventional-changelog/commitlint/issues/561)) ([6c3afcd](https://github.com/conventional-changelog/commitlint/commit/6c3afcd))
35
+
36
+
37
+
38
+
39
+ <a name="7.3.1"></a>
40
+ ## [7.3.1](https://github.com/conventional-changelog/commitlint/compare/v7.3.0...v7.3.1) (2019-01-11)
41
+
42
+
43
+
44
+
45
+ **Note:** Version bump only for package @commitlint/is-ignored
46
+
6
47
  <a name="7.3.0"></a>
7
- # [7.3.0](https://github.com/marionebl/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11)
48
+ # [7.3.0](https://github.com/conventional-changelog/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11)
8
49
 
9
50
 
10
51
 
@@ -12,7 +53,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
12
53
  **Note:** Version bump only for package @commitlint/is-ignored
13
54
 
14
55
  <a name="7.2.1"></a>
15
- ## [7.2.1](https://github.com/marionebl/commitlint/compare/v7.2.0...v7.2.1) (2018-10-11)
56
+ ## [7.2.1](https://github.com/conventional-changelog/commitlint/compare/v7.2.0...v7.2.1) (2018-10-11)
16
57
 
17
58
 
18
59
 
@@ -20,19 +61,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
20
61
  **Note:** Version bump only for package @commitlint/is-ignored
21
62
 
22
63
  <a name="7.2.0"></a>
23
- # [7.2.0](https://github.com/marionebl/commitlint/compare/v7.1.2...v7.2.0) (2018-10-05)
64
+ # [7.2.0](https://github.com/conventional-changelog/commitlint/compare/v7.1.2...v7.2.0) (2018-10-05)
24
65
 
25
66
 
26
67
  ### Bug Fixes
27
68
 
28
- * ignore merge messages with text after newline ([b32bc93](https://github.com/marionebl/commitlint/commit/b32bc93))
29
- * use grouped regex to ignore merge commits ([#439](https://github.com/marionebl/commitlint/issues/439)) ([905e9d5](https://github.com/marionebl/commitlint/commit/905e9d5))
69
+ * ignore merge messages with text after newline ([b32bc93](https://github.com/conventional-changelog/commitlint/commit/b32bc93))
70
+ * use grouped regex to ignore merge commits ([#439](https://github.com/conventional-changelog/commitlint/issues/439)) ([905e9d5](https://github.com/conventional-changelog/commitlint/commit/905e9d5))
30
71
 
31
72
 
32
73
 
33
74
 
34
75
  <a name="7.1.2"></a>
35
- ## [7.1.2](https://github.com/marionebl/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
76
+ ## [7.1.2](https://github.com/conventional-changelog/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
36
77
 
37
78
 
38
79
 
@@ -40,18 +81,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
40
81
  **Note:** Version bump only for package @commitlint/is-ignored
41
82
 
42
83
  <a name="7.1.0"></a>
43
- # [7.1.0](https://github.com/marionebl/commitlint/compare/v7.0.1...v7.1.0) (2018-08-29)
84
+ # [7.1.0](https://github.com/conventional-changelog/commitlint/compare/v7.0.1...v7.1.0) (2018-08-29)
44
85
 
45
86
 
46
87
  ### Features
47
88
 
48
- * **wildcards:** add new wildcard patterns [#315](https://github.com/marionebl/commitlint/issues/315) ([e9ea17f](https://github.com/marionebl/commitlint/commit/e9ea17f))
89
+ * **wildcards:** add new wildcard patterns [#315](https://github.com/conventional-changelog/commitlint/issues/315) ([e9ea17f](https://github.com/conventional-changelog/commitlint/commit/e9ea17f))
49
90
 
50
91
 
51
92
 
52
93
 
53
94
  <a name="6.1.1"></a>
54
- ## [6.1.1](https://github.com/marionebl/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22)
95
+ ## [6.1.1](https://github.com/conventional-changelog/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22)
55
96
 
56
97
 
57
98
 
@@ -59,7 +100,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
59
100
  **Note:** Version bump only for package @commitlint/is-ignored
60
101
 
61
102
  <a name="6.1.0"></a>
62
- # [6.1.0](https://github.com/marionebl/commitlint/compare/v6.0.5...v6.1.0) (2018-02-03)
103
+ # [6.1.0](https://github.com/conventional-changelog/commitlint/compare/v6.0.5...v6.1.0) (2018-02-03)
63
104
 
64
105
 
65
106
 
@@ -67,7 +108,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
67
108
  **Note:** Version bump only for package @commitlint/is-ignored
68
109
 
69
110
  <a name="6.0.4"></a>
70
- ## [6.0.4](https://github.com/marionebl/commitlint/compare/v6.0.3...v6.0.4) (2018-01-31)
111
+ ## [6.0.4](https://github.com/conventional-changelog/commitlint/compare/v6.0.3...v6.0.4) (2018-01-31)
71
112
 
72
113
 
73
114
 
@@ -75,31 +116,31 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
75
116
  **Note:** Version bump only for package @commitlint/is-ignored
76
117
 
77
118
  <a name="6.0.3"></a>
78
- ## [6.0.3](https://github.com/marionebl/commitlint/compare/v6.0.2...v6.0.3) (2018-01-31)
119
+ ## [6.0.3](https://github.com/conventional-changelog/commitlint/compare/v6.0.2...v6.0.3) (2018-01-31)
79
120
 
80
121
 
81
122
  ### Bug Fixes
82
123
 
83
- * update dependency semver to v5.5.0 ([#236](https://github.com/marionebl/commitlint/issues/236)) ([6c52bd9](https://github.com/marionebl/commitlint/commit/6c52bd9))
124
+ * update dependency semver to v5.5.0 ([#236](https://github.com/conventional-changelog/commitlint/issues/236)) ([6c52bd9](https://github.com/conventional-changelog/commitlint/commit/6c52bd9))
84
125
 
85
126
 
86
127
 
87
128
 
88
129
  <a name="6.0.2"></a>
89
- ## [6.0.2](https://github.com/marionebl/commitlint/compare/v6.0.0...v6.0.2) (2018-01-12)
130
+ ## [6.0.2](https://github.com/conventional-changelog/commitlint/compare/v6.0.0...v6.0.2) (2018-01-12)
90
131
 
91
132
 
92
133
  ### Bug Fixes
93
134
 
94
- * ignore branch merges with multiple newlines ([#227](https://github.com/marionebl/commitlint/issues/227)) ([1f0c5ca](https://github.com/marionebl/commitlint/commit/1f0c5ca))
135
+ * ignore branch merges with multiple newlines ([#227](https://github.com/conventional-changelog/commitlint/issues/227)) ([1f0c5ca](https://github.com/conventional-changelog/commitlint/commit/1f0c5ca))
95
136
 
96
137
 
97
138
 
98
139
 
99
140
  <a name="6.0.0"></a>
100
- # [6.0.0](https://github.com/marionebl/commitlint/compare/v5.2.6...v6.0.0) (2018-01-09)
141
+ # [6.0.0](https://github.com/conventional-changelog/commitlint/compare/v5.2.6...v6.0.0) (2018-01-09)
101
142
 
102
143
 
103
144
  ### Bug Fixes
104
145
 
105
- * ignore branch merges with newlines ([#214](https://github.com/marionebl/commitlint/issues/214)) ([c94c4dc](https://github.com/marionebl/commitlint/commit/c94c4dc))
146
+ * ignore branch merges with newlines ([#214](https://github.com/conventional-changelog/commitlint/issues/214)) ([c94c4dc](https://github.com/conventional-changelog/commitlint/commit/c94c4dc))
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.WILDCARDS = undefined;
6
7
  exports.default = isIgnored;
7
8
 
8
9
  var _semver = require('semver');
@@ -11,10 +12,22 @@ var _semver2 = _interopRequireDefault(_semver);
11
12
 
12
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14
 
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
+ const WILDCARDS = exports.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(.*)/), c => c.match(/^Auto-merged (.*?) into (.*)/)];
15
16
 
16
- function isIgnored(commit = '') {
17
- return WILDCARDS.some(w => w(commit));
17
+ function isIgnored(commit = '', opts = {}) {
18
+ const ignores = typeof opts.ignores === 'undefined' ? [] : opts.ignores;
19
+
20
+ if (!Array.isArray(ignores)) {
21
+ throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
22
+ }
23
+
24
+ const invalids = ignores.filter(c => typeof c !== 'function');
25
+
26
+ if (invalids.length > 0) {
27
+ throw new Error(`ignores must be array of type function, received items of type: ${invalids.map(i => typeof i).join(', ')}`);
28
+ }
29
+
30
+ const base = opts.defaults === false ? [] : WILDCARDS;
31
+ return [...base, ...ignores].some(w => w(commit));
18
32
  }
19
- module.exports = exports['default'];
20
33
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["isIgnored","WILDCARDS","c","match","valid","split","shift","replace","trim","commit","some","w"],"mappings":";;;;;kBAuBwBA,S;;AAvBxB;;;;;;AAEA,MAAMC,YAAY,CACjBC,KACCA,EAAEC,KAAF,CACC,mFADD,CAFgB,EAKjBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CALY,EAMjBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CANY,EAOjBD,KACC,iBAAOE,KAAP,CACCF,EACEG,KADF,CACQ,IADR,EAEEC,KAFF,GAGEC,OAHF,CAGU,qBAHV,EAGiC,EAHjC,EAIEC,IAJF,EADD,CARgB,EAejBN,KAAKA,EAAEC,KAAF,CAAQ,6BAAR,CAfY,EAgBjBD,KAAKA,EAAEC,KAAF,CAAQ,oCAAR,CAhBY,EAiBjBD,KAAKA,EAAEC,KAAF,CAAQ,4BAAR,CAjBY,EAkBjBD,KAAKA,EAAEC,KAAF,CAAQ,8BAAR,CAlBY,CAAlB;;AAqBe,SAASH,SAAT,CAAmBS,SAAS,EAA5B,EAAgC;AAC9C,QAAOR,UAAUS,IAAV,CAAeC,KAAKA,EAAEF,MAAF,CAApB,CAAP;AACA","file":"index.js","sourcesContent":["import semver from 'semver';\n\nconst WILDCARDS = [\n\tc =>\n\t\tc.match(\n\t\t\t/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\\r?\\n)*$)/m\n\t\t),\n\tc => c.match(/^(R|r)evert (.*)/),\n\tc => c.match(/^(fixup|squash)!/),\n\tc =>\n\t\tsemver.valid(\n\t\t\tc\n\t\t\t\t.split('\\n')\n\t\t\t\t.shift()\n\t\t\t\t.replace(/^chore(\\([^)]+\\))?:/, '')\n\t\t\t\t.trim()\n\t\t),\n\tc => c.match(/^Merged (.*?)(in|into) (.*)/),\n\tc => c.match(/^Merge remote-tracking branch (.*)/),\n\tc => c.match(/^Automatic merge from (.*)/),\n\tc => c.match(/^Auto-merged (.*?) into (.*)/)\n];\n\nexport default function isIgnored(commit = '') {\n\treturn WILDCARDS.some(w => w(commit));\n}\n"]}
1
+ {"version":3,"sources":["../src/index.js"],"names":["isIgnored","WILDCARDS","c","match","valid","split","shift","replace","trim","commit","opts","ignores","Array","isArray","Error","invalids","filter","length","map","i","join","base","defaults","some","w"],"mappings":";;;;;;kBAuBwBA,S;;AAvBxB;;;;;;AAEO,MAAMC,gCAAY,CACxBC,KACCA,EAAEC,KAAF,CACC,mFADD,CAFuB,EAKxBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CALmB,EAMxBD,KAAKA,EAAEC,KAAF,CAAQ,kBAAR,CANmB,EAOxBD,KACC,iBAAOE,KAAP,CACCF,EACEG,KADF,CACQ,IADR,EAEEC,KAFF,GAGEC,OAHF,CAGU,qBAHV,EAGiC,EAHjC,EAIEC,IAJF,EADD,CARuB,EAexBN,KAAKA,EAAEC,KAAF,CAAQ,6BAAR,CAfmB,EAgBxBD,KAAKA,EAAEC,KAAF,CAAQ,oCAAR,CAhBmB,EAiBxBD,KAAKA,EAAEC,KAAF,CAAQ,sBAAR,CAjBmB,EAkBxBD,KAAKA,EAAEC,KAAF,CAAQ,8BAAR,CAlBmB,CAAlB;;AAqBQ,SAASH,SAAT,CAAmBS,SAAS,EAA5B,EAAgCC,OAAO,EAAvC,EAA2C;AACzD,OAAMC,UAAU,OAAOD,KAAKC,OAAZ,KAAwB,WAAxB,GAAsC,EAAtC,GAA2CD,KAAKC,OAAhE;;AAEA,KAAI,CAACC,MAAMC,OAAN,CAAcF,OAAd,CAAL,EAA6B;AAC5B,QAAM,IAAIG,KAAJ,CACJ,2CAA0CH,OAAQ,YAAW,OAAOA,OAAQ,EADxE,CAAN;AAGA;;AAED,OAAMI,WAAWJ,QAAQK,MAAR,CAAed,KAAK,OAAOA,CAAP,KAAa,UAAjC,CAAjB;;AAEA,KAAIa,SAASE,MAAT,GAAkB,CAAtB,EAAyB;AACxB,QAAM,IAAIH,KAAJ,CACJ,mEAAkEC,SACjEG,GADiE,CAC7DC,KAAK,OAAOA,CADiD,EAEjEC,IAFiE,CAE5D,IAF4D,CAEtD,EAHR,CAAN;AAKA;;AAED,OAAMC,OAAOX,KAAKY,QAAL,KAAkB,KAAlB,GAA0B,EAA1B,GAA+BrB,SAA5C;AACA,QAAO,CAAC,GAAGoB,IAAJ,EAAU,GAAGV,OAAb,EAAsBY,IAAtB,CAA2BC,KAAKA,EAAEf,MAAF,CAAhC,CAAP;AACA","file":"index.js","sourcesContent":["import semver from 'semver';\n\nexport const WILDCARDS = [\n\tc =>\n\t\tc.match(\n\t\t\t/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\\r?\\n)*$)/m\n\t\t),\n\tc => c.match(/^(R|r)evert (.*)/),\n\tc => c.match(/^(fixup|squash)!/),\n\tc =>\n\t\tsemver.valid(\n\t\t\tc\n\t\t\t\t.split('\\n')\n\t\t\t\t.shift()\n\t\t\t\t.replace(/^chore(\\([^)]+\\))?:/, '')\n\t\t\t\t.trim()\n\t\t),\n\tc => c.match(/^Merged (.*?)(in|into) (.*)/),\n\tc => c.match(/^Merge remote-tracking branch (.*)/),\n\tc => c.match(/^Automatic merge(.*)/),\n\tc => c.match(/^Auto-merged (.*?) into (.*)/)\n];\n\nexport default function isIgnored(commit = '', opts = {}) {\n\tconst ignores = typeof opts.ignores === 'undefined' ? [] : opts.ignores;\n\n\tif (!Array.isArray(ignores)) {\n\t\tthrow new Error(\n\t\t\t`ignores must be of type array, received ${ignores} of type ${typeof ignores}`\n\t\t);\n\t}\n\n\tconst invalids = ignores.filter(c => typeof c !== 'function');\n\n\tif (invalids.length > 0) {\n\t\tthrow new Error(\n\t\t\t`ignores must be array of type function, received items of type: ${invalids\n\t\t\t\t.map(i => typeof i)\n\t\t\t\t.join(', ')}`\n\t\t);\n\t}\n\n\tconst base = opts.defaults === false ? [] : WILDCARDS;\n\treturn [...base, ...ignores].some(w => w(commit));\n}\n"]}
package/lib/index.test.js CHANGED
@@ -82,6 +82,7 @@ const AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {
82
82
  (0, _ava2.default)('should return true for bitbucket merge commits', t => {
83
83
  t.true((0, _2.default)('Merged in feature/facebook-friends-sync (pull request #8)'));
84
84
  t.true((0, _2.default)('Merged develop into feature/component-form-select-card'));
85
+ t.true((0, _2.default)('Automatic merge'));
85
86
  });
86
87
 
87
88
  (0, _ava2.default)('should return true for automatic merge commits', t => {
@@ -91,4 +92,32 @@ const AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {
91
92
  (0, _ava2.default)('should return false for commits containing, but not starting, with merge branch', t => {
92
93
  t.false((0, _2.default)('foo bar Merge branch xxx'));
93
94
  });
95
+
96
+ (0, _ava2.default)('should return false for ignored message if defaults is false', t => {
97
+ t.false((0, _2.default)('Auto-merged develop into master', {
98
+ defaults: false
99
+ }));
100
+ });
101
+
102
+ (0, _ava2.default)('should return false for ignored message if custom ignores and defaults is false', t => {
103
+ t.false((0, _2.default)('Auto-merged develop into master', {
104
+ defaults: false
105
+ }));
106
+ });
107
+
108
+ (0, _ava2.default)('should throw error if ignores is not an array', t => {
109
+ const ignoredString = 'this should be ignored';
110
+ t.throws(() => {
111
+ (0, _2.default)(ignoredString, {
112
+ ignores: 'throws error'
113
+ });
114
+ });
115
+ });
116
+
117
+ (0, _ava2.default)('should return true for custom ignores as function', t => {
118
+ const ignoredString = 'this should be ignored';
119
+ t.true((0, _2.default)(ignoredString, {
120
+ ignores: [c => c === ignoredString]
121
+ }));
122
+ });
94
123
  //# sourceMappingURL=index.test.js.map
@@ -1 +1 @@
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":";;AAAA;;;;AACA;;;;;;AAEA,MAAMA,mBAAmB,CACxB,OADwB,EAExB,OAFwB,EAGxB,OAHwB,EAIxB,aAJwB,EAKxB,sBALwB,EAMxB,SANwB,EAOxB,WAPwB,EAQxB,eARwB,EASxB,iBATwB,EAUxB,wBAVwB,EAWxB,0BAXwB,EAYxB,eAZwB,EAaxB,QAbwB,EAcxB,SAdwB,CAAzB;;AAiBA,MAAMC,aAAa,CAClB,gDADkB,EAElB,sDAFkB,EAGlB,sGAHkB,CAAnB;;AAMA,MAAMC,2BAA2BF,iBAAiBG,MAAjB,CAAwB,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC9E,QAAO,CACN,GAAGD,OADG,EAEN,GAAGH,WAAWK,GAAX,CAAeC,aAAc,GAAEF,OAAQ,OAAME,SAAU,EAAvD,CAFG,CAAP;AAIA,CALgC,EAK9B,EAL8B,CAAjC;;AAOA,mBAAK,mDAAL,EAA0DC,KAAK;AAC9DA,GAAEC,KAAF,CAAQ,iBAAR;AACA,CAFD;;AAIA,mBAAK,mDAAL,EAA0DD,KAAK;AAC9DA,GAAEC,KAAF,CAAQ,gBAAU,EAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,uCAAL,EAA8CD,KAAK;AAClDA,GAAEC,KAAF,CAAQ,gBAAU,gBAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,sCAAL,EAA6CD,KAAK;AACjDA,GAAEE,IAAF,CAAO,gBAAU,sBAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,8DAAL,EAAqEF,KAAK;AACzEA,GAAEE,IAAF,CAAO,gBAAU,kCAAV,CAAP;AACAF,GAAEE,IAAF,CAAO,gBAAU,oCAAV,CAAP;AACA,CAHD;;AAKA,mBAAK,uEAAL,EAA8EF,KAAK;AAClFA,GAAEE,IAAF,CAAO,gBAAU,sCAAV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AF,CAAO,gBAAU,wDAAV,CAAP;AACA,CALD;;AAOA,mBAAK,gDAAL,EAAuDF,KAAK;AAC3DA,GAAEE,IAAF,CAAO,gBAAU,iCAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,iFAAL,EAAwFF,KAAK;AAC5FA,GAAEC,KAAF,CAAQ,gBAAU,0BAAV,CAAR;AACA,CAFD","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"]}
1
+ {"version":3,"sources":["../src/index.test.js"],"names":["VERSION_MESSAGES","AMENDMENTS","AMENDED_VERSION_MESSAGES","reduce","results","message","map","amendment","t","false","true","forEach","defaults","ignoredString","throws","ignores","c"],"mappings":";;AAAA;;;;AACA;;;;;;AAEA,MAAMA,mBAAmB,CACxB,OADwB,EAExB,OAFwB,EAGxB,OAHwB,EAIxB,aAJwB,EAKxB,sBALwB,EAMxB,SANwB,EAOxB,WAPwB,EAQxB,eARwB,EASxB,iBATwB,EAUxB,wBAVwB,EAWxB,0BAXwB,EAYxB,eAZwB,EAaxB,QAbwB,EAcxB,SAdwB,CAAzB;;AAiBA,MAAMC,aAAa,CAClB,gDADkB,EAElB,sDAFkB,EAGlB,sGAHkB,CAAnB;;AAMA,MAAMC,2BAA2BF,iBAAiBG,MAAjB,CAAwB,CAACC,OAAD,EAAUC,OAAV,KAAsB;AAC9E,QAAO,CACN,GAAGD,OADG,EAEN,GAAGH,WAAWK,GAAX,CAAeC,aAAc,GAAEF,OAAQ,OAAME,SAAU,EAAvD,CAFG,CAAP;AAIA,CALgC,EAK9B,EAL8B,CAAjC;;AAOA,mBAAK,mDAAL,EAA0DC,KAAK;AAC9DA,GAAEC,KAAF,CAAQ,iBAAR;AACA,CAFD;;AAIA,mBAAK,mDAAL,EAA0DD,KAAK;AAC9DA,GAAEC,KAAF,CAAQ,gBAAU,EAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,uCAAL,EAA8CD,KAAK;AAClDA,GAAEC,KAAF,CAAQ,gBAAU,gBAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,sCAAL,EAA6CD,KAAK;AACjDA,GAAEE,IAAF,CAAO,gBAAU,sBAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,8DAAL,EAAqEF,KAAK;AACzEA,GAAEE,IAAF,CAAO,gBAAU,kCAAV,CAAP;AACAF,GAAEE,IAAF,CAAO,gBA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AFD;;AAIA,mBAAK,gDAAL,EAAuDF,KAAK;AAC3DA,GAAEE,IAAF,CACC,gBAAU,2DAAV,CADD;AAGAF,GAAEE,IAAF,CAAO,gBAAU,wDAAV,CAAP;AACAF,GAAEE,IAAF,CAAO,gBAAU,iBAAV,CAAP;AACA,CAND;;AAQA,mBAAK,gDAAL,EAAuDF,KAAK;AAC3DA,GAAEE,IAAF,CAAO,gBAAU,iCAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,iFAAL,EAAwFF,KAAK;AAC5FA,GAAEC,KAAF,CAAQ,gBAAU,0BAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,8DAAL,EAAqED,KAAK;AACzEA,GAAEC,KAAF,CACC,gBAAU,iCAAV,EAA6C;AAC5CG,YAAU;AADkC,EAA7C,CADD;AAKA,CAND;;AAQA,mBAAK,iFAAL,EAAwFJ,KAAK;AAC5FA,GAAEC,KAAF,CACC,gBAAU,iCAAV,EAA6C;AAC5CG,YAAU;AADkC,EAA7C,CADD;AAKA,CAND;;AAQA,mBAAK,+CAAL,EAAsDJ,KAAK;AAC1D,OAAMK,gBAAgB,wBAAtB;AACAL,GAAEM,MAAF,CAAS,MAAM;AACd,kBAAUD,aAAV,EAAyB;AACxBE,YAAS;AADe,GAAzB;AAGA,EAJD;AAKA,CAPD;;AASA,mBAAK,mDAAL,EAA0DP,KAAK;AAC9D,OAAMK,gBAAgB,wBAAtB;AACAL,GAAEE,IAAF,CACC,gBAAUG,aAAV,EAAyB;AACxBE,WAAS,CAACC,KAAKA,MAAMH,aAAZ;AADe,EAAzB,CADD;AAKA,CAPD","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\tt.true(isIgnored('Automatic merge'));\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\ntest('should return false for ignored message if defaults is false', t => {\n\tt.false(\n\t\tisIgnored('Auto-merged develop into master', {\n\t\t\tdefaults: false\n\t\t})\n\t);\n});\n\ntest('should return false for ignored message if custom ignores and defaults is false', t => {\n\tt.false(\n\t\tisIgnored('Auto-merged develop into master', {\n\t\t\tdefaults: false\n\t\t})\n\t);\n});\n\ntest('should throw error if ignores is not an array', t => {\n\tconst ignoredString = 'this should be ignored';\n\tt.throws(() => {\n\t\tisIgnored(ignoredString, {\n\t\t\tignores: 'throws error'\n\t\t});\n\t});\n});\n\ntest('should return true for custom ignores as function', t => {\n\tconst ignoredString = 'this should be ignored';\n\tt.true(\n\t\tisIgnored(ignoredString, {\n\t\t\tignores: [c => c === ignoredString]\n\t\t})\n\t);\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commitlint/is-ignored",
3
- "version": "7.3.0",
3
+ "version": "7.6.0",
4
4
  "description": "Lint your commit messages",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -8,10 +8,8 @@
8
8
  ],
9
9
  "scripts": {
10
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
12
  "pkg": "pkg-check",
14
- "lint": "xo",
15
13
  "start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
16
14
  "test": "ava -c 4 --verbose",
17
15
  "watch": "babel src --out-dir lib --watch --source-maps"
@@ -35,18 +33,17 @@
35
33
  "babel-preset-commitlint"
36
34
  ]
37
35
  },
38
- "xo": false,
39
36
  "engines": {
40
37
  "node": ">=4"
41
38
  },
42
39
  "repository": {
43
40
  "type": "git",
44
- "url": "https://github.com/marionebl/commitlint.git"
41
+ "url": "https://github.com/conventional-changelog/commitlint.git"
45
42
  },
46
43
  "bugs": {
47
- "url": "https://github.com/marionebl/commitlint/issues"
44
+ "url": "https://github.com/conventional-changelog/commitlint/issues"
48
45
  },
49
- "homepage": "https://github.com/marionebl/commitlint#readme",
46
+ "homepage": "https://github.com/conventional-changelog/commitlint#readme",
50
47
  "keywords": [
51
48
  "conventional-changelog",
52
49
  "commitlint",
@@ -59,19 +56,17 @@
59
56
  },
60
57
  "license": "MIT",
61
58
  "devDependencies": {
62
- "@commitlint/parse": "^7.3.0",
63
- "@commitlint/test": "^7.3.0",
64
- "@commitlint/utils": "^7.3.0",
59
+ "@commitlint/parse": "^7.6.0",
60
+ "@commitlint/test": "^7.6.0",
61
+ "@commitlint/utils": "^7.6.0",
65
62
  "ava": "0.22.0",
66
63
  "babel-cli": "6.26.0",
67
- "babel-preset-commitlint": "^7.3.0",
64
+ "babel-preset-commitlint": "^7.6.0",
68
65
  "babel-register": "6.26.0",
69
66
  "concurrently": "3.5.1",
70
- "cross-env": "5.1.1",
71
- "rimraf": "2.6.1",
72
- "xo": "0.20.3"
67
+ "cross-env": "5.1.1"
73
68
  },
74
69
  "dependencies": {
75
- "semver": "5.6.0"
70
+ "semver": "6.0.0"
76
71
  }
77
72
  }