From 2986633b6d632a82b4686210441a96e0ba9acffe Mon Sep 17 00:00:00 2001 From: Fabio Elia Date: Mon, 12 Dec 2016 10:39:50 -0500 Subject: [PATCH 1/4] Add eslint reporter --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1c7820d..356d58c 100644 --- a/index.js +++ b/index.js @@ -189,7 +189,9 @@ module.exports = function (options) { eslint_output = ['**Please fix these eslint issues first:**'], opt = options || {}, jshint_reporter = opt.jshint_reporter || jshint_simple_reporter, - jscs_reporter = opt.jscs_reporter || jscs_simple_reporter; + jscs_reporter = opt.jscs_reporter || jscs_simple_reporter, + eslint_reporter = opt.eslint_reporter || eslint_simple_reporter; + return through.obj(function (file, enc, callback) { if (file.jshint && !file.jshint.success && !file.jshint.ignored) { @@ -206,7 +208,7 @@ module.exports = function (options) { if (file.eslint) { file.eslint.messages.forEach(function (E) { - eslint_output.push(eslint_simple_reporter(E, file)); + eslint_output.push(eslint_reporter(E, file)); }); } From 33e1550e71b871d95195d4b6dc4fa868fe09c795 Mon Sep 17 00:00:00 2001 From: "Mike P. Sinn" Date: Mon, 10 Dec 2018 18:13:05 -0600 Subject: [PATCH 2/4] Allow for target_url on statuses --- .gitignore | 1 + index.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3cdc0ad..e5f98f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules coverage artifacts +.idea/ diff --git a/index.js b/index.js index 356d58c..e8124e1 100644 --- a/index.js +++ b/index.js @@ -59,14 +59,16 @@ var commentToPR = function (body, opt, cb) { }; var createStatusToCommit = function (state, opt, cb) { - getGIT(opt).repos.createStatus({ + var statusOptions = { user: opt.git_repo.split('/')[0], repo: opt.git_repo.split('/')[1], sha: opt.git_sha, state: state.state, description: state.description, context: state.context - }, cb); + }; + if(state.target_url){statusOptions.target_url = state.target_url;} + getGIT(opt).repos.createStatus(statusOptions, cb); }; var isPullRequest = function (opt) { From 5d5ec40d17056e0ab86209197ba3e2b79ee2e9d3 Mon Sep 17 00:00:00 2001 From: "Mike P. Sinn" Date: Mon, 10 Dec 2018 18:17:36 -0600 Subject: [PATCH 3/4] Added target_url to README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 954a38f..c940fb9 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ gulp.task('lint_report_github', function () { console.log(E.message); // This handled jscs stream error. }) .pipe(eslint()) - .pipe(github(options)); // Comment issues in github PR! + .pipe(github(options)) // Comment issues in github PR! .pipe(github.failThisTask()); // Fail this task when jscs/jshint/eslint issues found. }); @@ -54,7 +54,8 @@ github.commentToPR('Yes! it works!!', options); github.createStatusToCommit({ description: 'No! 2 failures...', context: 'my gulp task', - state: 'failure' + state: 'failure', + target_url: 'http://www.homerswebpage.com/' }, options); // Or, create a task to reject PR with merged commits From c001aa1cc4bfe83f9a387ef65d941afddd1c1544 Mon Sep 17 00:00:00 2001 From: Zordius Chen <1201409+zordius@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:02:15 +0800 Subject: [PATCH 4/4] release --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e7dad8e..686354d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "gulp-github", - "version": "0.3.5", + "version": "0.3.6", "description": "A gulp plugin to pipe contents to github pull request comments.", - "author": "Zordius ", + "author": "Zordius ", "contributors": [ { "name": "Zordius Chen",