New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jira-precommit-hook

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jira-precommit-hook - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

lib/outdated-check.js

5

lib/fs-utils.js
'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 @@

4

lib/issue-strategies/index.js
'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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc