jira-precommit-hook
Advanced tools
Comparing version 1.0.2 to 1.1.0
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -9,6 +7,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.findParentFolder = findParentFolder; | ||
@@ -15,0 +12,0 @@ exports.verifyHooksFolder = verifyHooksFolder; |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -9,6 +7,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.issueStrategizer = issueStrategizer; | ||
@@ -15,0 +12,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.apply = apply; | ||
@@ -12,0 +9,0 @@ |
"use strict"; | ||
var _Object$defineProperty = require("babel-runtime/core-js/object/define-property")["default"]; | ||
var _Promise = require("babel-runtime/core-js/promise")["default"]; | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.apply = apply; | ||
@@ -12,0 +9,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _interopRequireWildcard = require('babel-runtime/helpers/interop-require-wildcard')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
@@ -9,0 +7,0 @@ }); |
"use strict"; | ||
var _Object$defineProperty = require("babel-runtime/core-js/object/define-property")["default"]; | ||
var _Promise = require("babel-runtime/core-js/promise")["default"]; | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.apply = apply; | ||
@@ -12,0 +9,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -9,6 +7,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.apply = apply; | ||
@@ -15,0 +12,0 @@ |
"use strict"; | ||
var _Object$defineProperty = require("babel-runtime/core-js/object/define-property")["default"]; | ||
var _Promise = require("babel-runtime/core-js/promise")["default"]; | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.apply = apply; | ||
@@ -12,0 +9,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.validateAPIConfig = validateAPIConfig; | ||
@@ -12,0 +9,0 @@ exports.validateAuthentication = validateAuthentication; |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -11,6 +9,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.getJiraAPI = getJiraAPI; | ||
@@ -17,0 +14,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -9,6 +7,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.findProjectKey = findProjectKey; | ||
@@ -91,3 +88,3 @@ exports.findIssueLinkParentKey = findIssueLinkParentKey; | ||
default: | ||
return _Promise.reject('' + issue.fields.issuetype.name + ' should not have a parent.'); | ||
return _Promise.reject(issue.fields.issuetype.name + ' should not have a parent.'); | ||
} | ||
@@ -94,0 +91,0 @@ }, function (issue) { |
@@ -6,4 +6,2 @@ /* eslint no-process-exit:0 */ | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -15,6 +13,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.getIssueReference = getIssueReference; | ||
@@ -44,6 +41,10 @@ exports.getCommitMsg = getCommitMsg; | ||
var _outdatedCheck = require('./outdated-check'); | ||
var _outdatedCheck2 = _interopRequireDefault(_outdatedCheck); | ||
require('colors'); | ||
function getIssueReference(msgToParse, prjKey) { | ||
var pattern = RegExp('' + prjKey + '-\\d+', 'g'); | ||
var pattern = RegExp(prjKey + '-\\d+', 'g'); | ||
var commentPattern = RegExp('^#.*$', 'gm'); | ||
@@ -89,25 +90,28 @@ | ||
function precommit(path) { | ||
var readPromise = _fsPromise2['default'].readFile(path, { encoding: 'utf8' }); | ||
return (0, _outdatedCheck2['default'])().then(function () { | ||
var readPromise = _fsPromise2['default'].readFile(path, { encoding: 'utf8' }); | ||
return getCommitMsg(readPromise).then(function () { | ||
return 0; | ||
})['catch'](function (err) { | ||
return readPromise.then(function (contents) { | ||
console.log('Commit Message:'); | ||
console.log(contents); | ||
return getCommitMsg(readPromise).then(function () { | ||
console.log('[jira-precommit-hook] '.grey + 'Commit message successfully verified.'.cyan); | ||
return 0; | ||
})['catch'](function (err) { | ||
return readPromise.then(function (contents) { | ||
console.log('Commit Message:'); | ||
console.log(contents); | ||
if (typeof err === 'string') { | ||
console.error(err.red); | ||
} else if (process.env.NODE_ENV === 'development') { | ||
console.error(err.stack.red); | ||
} else { | ||
console.error(err.toString().red); | ||
} | ||
if (typeof err === 'string') { | ||
console.error(err.red); | ||
} else if (process.env.NODE_ENV === 'development') { | ||
console.error(err.stack.red); | ||
} else { | ||
console.error(err.toString().red); | ||
} | ||
return 1; | ||
})['catch'](function (err2) { | ||
console.log('Failed to read commit message file.'.red); | ||
return 1; | ||
return 1; | ||
})['catch'](function (err2) { | ||
console.log('Failed to read commit message file.'.red); | ||
return 1; | ||
}); | ||
}); | ||
}); | ||
} |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.anyPromise = anyPromise; | ||
@@ -12,0 +9,0 @@ |
"use strict"; | ||
var _Object$defineProperty = require("babel-runtime/core-js/object/define-property")["default"]; | ||
var _Promise = require("babel-runtime/core-js/promise")["default"]; | ||
_Object$defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = apply; | ||
@@ -12,0 +9,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports['default'] = apply; | ||
@@ -12,0 +9,0 @@ |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
@@ -9,0 +7,0 @@ }); |
'use strict'; | ||
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default']; | ||
var _Promise = require('babel-runtime/core-js/promise')['default']; | ||
@@ -11,6 +9,5 @@ | ||
_Object$defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports['default'] = apply; | ||
@@ -29,3 +26,3 @@ | ||
if (!_issueStrategiesIndexJs2['default'][content.fields.issuetype.name]) { | ||
return _Promise.reject(new Error('' + issueKey + ' does not have a valid issuetype')); | ||
return _Promise.reject(new Error(issueKey + ' does not have a valid issuetype')); | ||
} | ||
@@ -32,0 +29,0 @@ |
{ | ||
"name": "jira-precommit-hook", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Git commit hook to verify commit messages are tagged with a JIRA issue number", | ||
@@ -35,10 +35,10 @@ "main": "lib/index.js", | ||
"babel": "^5.1.11", | ||
"babel-eslint": "^3.0.1", | ||
"chai": "^2.2.0", | ||
"babel-eslint": "^4.0.5", | ||
"chai": "^3.2.0", | ||
"chai-as-promised": "^5.0.0", | ||
"eslint": "^0.20.0", | ||
"eslint": "^0.24.1", | ||
"mocha": "^2.2.4", | ||
"rimraf": "^2.3.4", | ||
"sinon": "^1.14.1", | ||
"sinon-as-promised": "^3.0.0", | ||
"sinon-as-promised": "^4.0.0", | ||
"sinon-chai": "^2.7.0" | ||
@@ -52,3 +52,4 @@ }, | ||
"jira": "^0.9.2", | ||
"lodash": "^3.8.0" | ||
"lodash": "^3.8.0", | ||
"request-promise": "^0.4.3" | ||
}, | ||
@@ -55,0 +56,0 @@ "repository": { |
24
569
27601
7
+ Addedrequest-promise@^0.4.3
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbluebird@2.11.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequest-promise@0.4.3(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)