@commitlint/core
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="6.1.0"></a> | ||
# [6.1.0](https://github.com/marionebl/commitlint/compare/v6.0.5...v6.1.0) (2018-02-03) | ||
### Features | ||
* add "--config" option ([#261](https://github.com/marionebl/commitlint/issues/261)) ([2c03ec6](https://github.com/marionebl/commitlint/commit/2c03ec6)) | ||
<a name="6.0.5"></a> | ||
@@ -8,0 +19,0 @@ ## [6.0.5](https://github.com/marionebl/commitlint/compare/v6.0.4...v6.0.5) (2018-01-31) |
@@ -61,3 +61,3 @@ 'use strict'; | ||
options = $args.length > 1 && $args[1] !== undefined ? $args[1] : { cwd: process.cwd() }; | ||
return Promise.resolve(loadConfig(options.cwd)).then(function ($await_3) { | ||
return Promise.resolve(loadConfig(options.cwd, options.file)).then(function ($await_3) { | ||
try { | ||
@@ -168,3 +168,3 @@ loaded = $await_3; | ||
function loadConfig(cwd) { | ||
function loadConfig(cwd, configPath) { | ||
return new Promise(function ($return, $error) { | ||
@@ -174,3 +174,4 @@ var explorer, local; | ||
explorer = (0, _cosmiconfig2.default)('commitlint', { | ||
rcExtensions: true | ||
rcExtensions: true, | ||
configPath: configPath ? _path2.default.resolve(cwd, configPath) : null | ||
}); | ||
@@ -177,0 +178,0 @@ |
@@ -63,2 +63,26 @@ 'use strict'; | ||
(0, _ava2.default)('rules should be loaded from specify config file', function (t) { | ||
return new Promise(function ($return, $error) { | ||
var file, cwd, actual; | ||
file = 'config/commitlint.config.js'; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/specify-config-file')).then(function ($await_5) { | ||
try { | ||
cwd = $await_5; | ||
return Promise.resolve((0, _load2.default)({}, { cwd, file })).then(function ($await_6) { | ||
try { | ||
actual = $await_6; | ||
t.is(actual.rules.foo, 'bar'); | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this)); | ||
}); | ||
(0, _ava2.default)('uses seed with parserPreset', function (t) { | ||
@@ -68,10 +92,10 @@ return new Promise(function ($return, $error) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/parser-preset')).then(function ($await_5) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/parser-preset')).then(function ($await_7) { | ||
try { | ||
cwd = $await_5; | ||
cwd = $await_7; | ||
return Promise.resolve((0, _load2.default)({ | ||
parserPreset: './conventional-changelog-custom' | ||
}, { cwd })).then(function ($await_6) { | ||
}, { cwd })).then(function ($await_8) { | ||
try { | ||
_ref = $await_6, actual = _ref.parserPreset; | ||
_ref = $await_8, actual = _ref.parserPreset; | ||
@@ -97,6 +121,6 @@ t.is(actual.name, './conventional-changelog-custom'); | ||
var cwd; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/extends-invalid')).then(function ($await_7) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/extends-invalid')).then(function ($await_9) { | ||
try { | ||
cwd = $await_7; | ||
return Promise.resolve(t.throws((0, _load2.default)({}, { cwd }))).then(function ($await_8) { | ||
cwd = $await_9; | ||
return Promise.resolve(t.throws((0, _load2.default)({}, { cwd }))).then(function ($await_10) { | ||
try { | ||
@@ -118,8 +142,8 @@ return $return(); | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/empty-object-file')).then(function ($await_9) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/empty-object-file')).then(function ($await_11) { | ||
try { | ||
cwd = $await_9; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_10) { | ||
cwd = $await_11; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_12) { | ||
try { | ||
actual = $await_10; | ||
actual = $await_12; | ||
t.deepEqual(actual.rules, {}); | ||
@@ -141,8 +165,8 @@ return $return(); | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/empty-file')).then(function ($await_11) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/empty-file')).then(function ($await_13) { | ||
try { | ||
cwd = $await_11; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_12) { | ||
cwd = $await_13; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_14) { | ||
try { | ||
actual = $await_12; | ||
actual = $await_14; | ||
t.deepEqual(actual.extends, []); | ||
@@ -164,8 +188,8 @@ return $return(); | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends/first-extended')).then(function ($await_13) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends/first-extended')).then(function ($await_15) { | ||
try { | ||
cwd = $await_13; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_14) { | ||
cwd = $await_15; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_16) { | ||
try { | ||
actual = $await_14; | ||
actual = $await_16; | ||
t.deepEqual(actual, { | ||
@@ -193,8 +217,8 @@ extends: ['./second-extended'], | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends')).then(function ($await_15) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends')).then(function ($await_17) { | ||
try { | ||
cwd = $await_15; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_16) { | ||
cwd = $await_17; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_18) { | ||
try { | ||
actual = $await_16; | ||
actual = $await_18; | ||
t.deepEqual(actual, { | ||
@@ -223,8 +247,8 @@ extends: ['./first-extended'], | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-json')).then(function ($await_17) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-json')).then(function ($await_19) { | ||
try { | ||
cwd = $await_17; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_18) { | ||
cwd = $await_19; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_20) { | ||
try { | ||
actual = $await_18; | ||
actual = $await_20; | ||
@@ -254,8 +278,8 @@ t.deepEqual(actual, { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-yaml')).then(function ($await_19) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-yaml')).then(function ($await_21) { | ||
try { | ||
cwd = $await_19; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_20) { | ||
cwd = $await_21; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_22) { | ||
try { | ||
actual = $await_20; | ||
actual = $await_22; | ||
@@ -285,8 +309,8 @@ t.deepEqual(actual, { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-js')).then(function ($await_21) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-js')).then(function ($await_23) { | ||
try { | ||
cwd = $await_21; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_22) { | ||
cwd = $await_23; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_24) { | ||
try { | ||
actual = $await_22; | ||
actual = $await_24; | ||
@@ -316,8 +340,8 @@ t.deepEqual(actual, { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-package')).then(function ($await_23) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-extends-package')).then(function ($await_25) { | ||
try { | ||
cwd = $await_23; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_24) { | ||
cwd = $await_25; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_26) { | ||
try { | ||
actual = $await_24; | ||
actual = $await_26; | ||
@@ -347,8 +371,8 @@ t.deepEqual(actual, { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/parser-preset-override')).then(function ($await_25) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/parser-preset-override')).then(function ($await_27) { | ||
try { | ||
cwd = $await_25; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_26) { | ||
cwd = $await_27; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_28) { | ||
try { | ||
actual = $await_26; | ||
actual = $await_28; | ||
t.is(actual.parserPreset.name, './custom'); | ||
@@ -373,8 +397,8 @@ t.deepEqual(actual.parserPreset.parserOpts, { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-parser-preset')).then(function ($await_27) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/recursive-parser-preset')).then(function ($await_29) { | ||
try { | ||
cwd = $await_27; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_28) { | ||
cwd = $await_29; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_30) { | ||
try { | ||
actual = $await_28; | ||
actual = $await_30; | ||
t.is(actual.parserPreset.name, './conventional-changelog-custom'); | ||
@@ -398,8 +422,8 @@ t.is(typeof actual.parserPreset.parserOpts, 'object'); | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/trash-file')).then(function ($await_29) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/trash-file')).then(function ($await_31) { | ||
try { | ||
cwd = $await_29; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_30) { | ||
cwd = $await_31; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_32) { | ||
try { | ||
actual = $await_30; | ||
actual = $await_32; | ||
@@ -428,8 +452,8 @@ t.deepEqual(actual, { | ||
var cwd, actual; | ||
return Promise.resolve(_test.git.bootstrap('fixtures/trash-extend')).then(function ($await_31) { | ||
return Promise.resolve(_test.git.bootstrap('fixtures/trash-extend')).then(function ($await_33) { | ||
try { | ||
cwd = $await_31; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_32) { | ||
cwd = $await_33; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_34) { | ||
try { | ||
actual = $await_32; | ||
actual = $await_34; | ||
@@ -458,12 +482,12 @@ t.deepEqual(actual, { | ||
var outer, cwd, actual; | ||
return Promise.resolve(_test.fix.bootstrap('fixtures/outer-scope')).then(function ($await_33) { | ||
return Promise.resolve(_test.fix.bootstrap('fixtures/outer-scope')).then(function ($await_35) { | ||
try { | ||
outer = $await_33; | ||
return Promise.resolve(_test.git.init(_path2.default.join(outer, 'inner-scope'))).then(function ($await_34) { | ||
outer = $await_35; | ||
return Promise.resolve(_test.git.init(_path2.default.join(outer, 'inner-scope'))).then(function ($await_36) { | ||
try { | ||
cwd = _path2.default.join(outer, 'inner-scope', 'child-scope'); | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_35) { | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_37) { | ||
try { | ||
actual = $await_35; | ||
actual = $await_37; | ||
@@ -497,11 +521,11 @@ t.deepEqual(actual, { | ||
var outer, cwd, actual; | ||
return Promise.resolve(_test.fix.bootstrap('fixtures/outer-scope')).then(function ($await_36) { | ||
return Promise.resolve(_test.fix.bootstrap('fixtures/outer-scope')).then(function ($await_38) { | ||
try { | ||
outer = $await_36; | ||
return Promise.resolve(_test.git.init(_path2.default.join(outer, 'inner-scope'))).then(function ($await_37) { | ||
outer = $await_38; | ||
return Promise.resolve(_test.git.init(_path2.default.join(outer, 'inner-scope'))).then(function ($await_39) { | ||
try { | ||
cwd = $await_37; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_38) { | ||
cwd = $await_39; | ||
return Promise.resolve((0, _load2.default)({}, { cwd })).then(function ($await_40) { | ||
try { | ||
actual = $await_38; | ||
actual = $await_40; | ||
@@ -508,0 +532,0 @@ t.deepEqual(actual, { |
{ | ||
"name": "@commitlint/core", | ||
"version": "6.0.5", | ||
"version": "6.1.0", | ||
"description": "Lint your commit messages", | ||
@@ -62,8 +62,8 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@commitlint/parse": "^6.0.4", | ||
"@commitlint/test": "^6.0.4", | ||
"@commitlint/utils": "^6.0.4", | ||
"@commitlint/parse": "^6.1.0", | ||
"@commitlint/test": "^6.1.0", | ||
"@commitlint/utils": "^6.1.0", | ||
"ava": "0.22.0", | ||
"babel-cli": "6.26.0", | ||
"babel-preset-commitlint": "^6.0.4", | ||
"babel-preset-commitlint": "^6.1.0", | ||
"babel-register": "6.26.0", | ||
@@ -80,8 +80,8 @@ "concurrently": "3.5.1", | ||
"dependencies": { | ||
"@commitlint/execute-rule": "^6.0.4", | ||
"@commitlint/is-ignored": "^6.0.4", | ||
"@commitlint/parse": "^6.0.4", | ||
"@commitlint/resolve-extends": "^6.0.4", | ||
"@commitlint/rules": "^6.0.4", | ||
"@commitlint/top-level": "^6.0.5", | ||
"@commitlint/execute-rule": "^6.1.0", | ||
"@commitlint/is-ignored": "^6.1.0", | ||
"@commitlint/parse": "^6.1.0", | ||
"@commitlint/resolve-extends": "^6.1.0", | ||
"@commitlint/rules": "^6.1.0", | ||
"@commitlint/top-level": "^6.1.0", | ||
"@marionebl/sander": "^0.6.0", | ||
@@ -88,0 +88,0 @@ "babel-runtime": "^6.23.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
131190
1.54%1578
1.48%