Navigation Menu

Skip to content

Commit

Permalink
✅ Appease the standard globs with standard --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb committed Nov 15, 2018
1 parent 1e7aff9 commit 4b803ac
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
8 changes: 4 additions & 4 deletions bin/good-first-issue.js
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion bin/prompt.js
Expand Up @@ -12,4 +12,4 @@ module.exports = async function () {
}
])
return a.project
}
}
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -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)
}
})
}
})
}
10 changes: 5 additions & 5 deletions lib/log.js
Expand Up @@ -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
module.exports = log
2 changes: 1 addition & 1 deletion lib/projects.js
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/search.js
Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions package.json
Expand Up @@ -22,6 +22,11 @@
"keywords": [],
"author": "Tierney Cyren <hello@bnb.im> (http://bnb.im)",
"license": "MIT",
"standard": {
"ignore": [
"**/*.spec.js"
]
},
"dependencies": {
"@octokit/rest": "^15.15.1",
"boxen": "^2.0.0",
Expand Down

0 comments on commit 4b803ac

Please sign in to comment.