From 4b803acef99cc8be3995be1927fef9464eb947f9 Mon Sep 17 00:00:00 2001 From: Tierney Cyren Date: Thu, 15 Nov 2018 17:31:36 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Appease=20the=20standard=20globs=20?= =?UTF-8?q?with=20`standard=20--fix`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/good-first-issue.js | 8 ++++---- bin/prompt.js | 2 +- index.js | 6 +++--- lib/log.js | 10 +++++----- lib/projects.js | 2 +- lib/search.js | 2 +- package.json | 5 +++++ 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/bin/good-first-issue.js b/bin/good-first-issue.js index 8af0312..7032424 100755 --- a/bin/good-first-issue.js +++ b/bin/good-first-issue.js @@ -47,15 +47,15 @@ cli } // Call the log functionality, output the result to the console. - log(issues, projects[input].name, function(error, output) { - if(error) throw error + log(issues, projects[input].name, function (error, output) { + if (error) throw error // Configure the randomizer for the pool of good-first-issues. This cannot exceed how many entries are actually available from the API. - var key = Math.floor(Math.random() * Math.floor(output.length - 1)); + var key = Math.floor(Math.random() * Math.floor(output.length - 1)) if (cmd.first) { key = 0 } - + if (cmd.open) { opn(issues[key].url) } diff --git a/bin/prompt.js b/bin/prompt.js index ea075d1..c0140ac 100644 --- a/bin/prompt.js +++ b/bin/prompt.js @@ -12,4 +12,4 @@ module.exports = async function () { } ]) return a.project -} \ No newline at end of file +} diff --git a/index.js b/index.js index 39eac54..cc0b1e8 100644 --- a/index.js +++ b/index.js @@ -3,10 +3,10 @@ const projects = require('./lib/projects') module.exports = function (project, cb) { search(projects[project].q, (error, issues) => { - if(error) { + if (error) { cb(error, null) } else { cb(null, issues) } - }) -} \ No newline at end of file + }) +} diff --git a/lib/log.js b/lib/log.js index 18fd567..b20277a 100644 --- a/lib/log.js +++ b/lib/log.js @@ -14,19 +14,19 @@ function log (issues, project, cb) { doublepad: ' ', header: 'Good First Issue in ' + chalk.yellow(project) + ': ', title: chalk.green(issues[issue].title), - issue: chalk.cyan('#' + issues[issue].pr), - state: chalk.green(issues[issue].state), + issue: chalk.cyan('#' + issues[issue].pr), + state: chalk.green(issues[issue].state), unassigned: chalk.green('unassigned!'), // All assigned issues are being filtered out at the search level, so all issues will always be unassigned link: chalk.cyan(issues[issue].url), repo: chalk.green(issues[issue].url.toString().slice(19, issues[issue].url.toString().indexOf('/', 30))), labels: issues[issue].labels } - var output = '\n' + boxen(data.header + '\n\n' + ' - Title: ' + data.title + '\n' + ' - Repository: ' + data.repo + '\n' + ' - Issue: ' + data.issue + '\n' + ' - Status: ' + data.state + '\n' + ' - Assigned to: ' + data.unassigned + '\n\n' + 'Start now: ' + data.link, boxenOptions) + '\n' + var output = '\n' + boxen(data.header + '\n\n' + ' - Title: ' + data.title + '\n' + ' - Repository: ' + data.repo + '\n' + ' - Issue: ' + data.issue + '\n' + ' - Status: ' + data.state + '\n' + ' - Assigned to: ' + data.unassigned + '\n\n' + 'Start now: ' + data.link, boxenOptions) + '\n' set.push(output) - } + } cb(null, set) } -module.exports = log \ No newline at end of file +module.exports = log diff --git a/lib/projects.js b/lib/projects.js index e40db41..235806e 100644 --- a/lib/projects.js +++ b/lib/projects.js @@ -25,7 +25,7 @@ var projects = { wolkenkit: { name: 'wolkenkit', q: 'repo:thenativeweb/wolkenkit is:issue is:open sort:updated-desc label:"Good first issue"' - }, + } } module.exports = projects diff --git a/lib/search.js b/lib/search.js index 5f84611..b50ca3f 100644 --- a/lib/search.js +++ b/lib/search.js @@ -12,7 +12,7 @@ const octokit = require('@octokit/rest')({ var sort = 'updated' var order = 'desc' -function search(q) { +function search (q) { return octokit.search.issues({ q, sort, order }).then(({ data }) => { return data.items.reduce((acc, item) => { if (item.assignee === null && item.locked !== true) { diff --git a/package.json b/package.json index 8f05802..f3ba2d9 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,11 @@ "keywords": [], "author": "Tierney Cyren (http://bnb.im)", "license": "MIT", + "standard": { + "ignore": [ + "**/*.spec.js" + ] + }, "dependencies": { "@octokit/rest": "^15.15.1", "boxen": "^2.0.0",