Skip to content

Commit

Permalink
chore: consolidate linting to monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jun 20, 2018
1 parent c60fb61 commit f12acda
Show file tree
Hide file tree
Showing 31 changed files with 316 additions and 500 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- run: apt-get install -y bats
- run: yarn
- run: yarn test
- run: eslint .
- run: ./node_modules/.bin/lerna exec "curl -s https://codecov.io/bash | bash"
- run: greenkeeper-lockfile-upload
release:
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/lib
node_modules
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "oclif"
"extends": "standard",
"env": {
"mocha": true
}
}
1 change: 0 additions & 1 deletion packages/auth/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/auth/.eslintrc

This file was deleted.

45 changes: 0 additions & 45 deletions packages/cli/src/legacy.test.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/ps/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ps/.eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions packages/run-v5/lib/colorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function colorizeWeb (body) {
state(stateChange[4])
].join('')
}
let apache = body.match(/^(\d+\.\d+\.\d+\.\d+ -[^-]*- \[[^\]]+\] ")(\w+)( )([^ ]+)( HTTP\/\d+\.\d+" )(\d+)( .+$)/)
let apache = body.match(/^(\d+\.\d+\.\d+\.\d+ -[^-]*- \[[^\]]+] ")(\w+)( )([^ ]+)( HTTP\/\d+\.\d+" )(\d+)( .+$)/)
if (apache) {
const [, ...tokens] = apache
return [
Expand Down Expand Up @@ -238,7 +238,7 @@ function colorizeRedis (body) {
}

function colorizePG (body) {
let create = body.match(/^(\[DATABASE\].*)(CREATE TABLE)(.*)$/)
let create = body.match(/^(\[DATABASE].*)(CREATE TABLE)(.*)$/)
if (create) {
return [
other(create[1]),
Expand Down
3 changes: 0 additions & 3 deletions packages/webhooks-v5/.eslintrc

This file was deleted.

10 changes: 5 additions & 5 deletions packages/webhooks-v5/commands/webhooks/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../lib/webhook-type.js')

class Add extends Command {
async run() {
async run () {
const {flags} = this.parse(Add)
let {path, display} = webhookType(flags)

Expand All @@ -15,8 +15,8 @@ class Add extends Command {
level: flags.level,
secret: flags.secret,
url: flags.url,
authorization: flags.authorization,
},
authorization: flags.authorization
}
})
let secret
if (response.headers) secret = response.headers['heroku-webhook-secret']
Expand All @@ -33,7 +33,7 @@ class Add extends Command {
Add.description = 'add a webhook to an app'

Add.examples = [
'$ heroku webhooks:add -i api:dyno -l notify -u https://example.com/hooks',
'$ heroku webhooks:add -i api:dyno -l notify -u https://example.com/hooks'
]

Add.flags = {
Expand All @@ -43,7 +43,7 @@ Add.flags = {
level: flags.string({char: 'l', description: 'notify does not retry, sync will retry until successful or timeout', required: true}),
secret: flags.string({char: 's', description: 'value to sign delivery with in Heroku-Webhook-Hmac-SHA256 header'}),
authorization: flags.string({char: 't', description: 'authoriation header to send with webhooks'}),
url: flags.string({char: 'u', description: 'URL for receiver', required: true}),
url: flags.string({char: 'u', description: 'URL for receiver', required: true})
}

module.exports = Add
12 changes: 6 additions & 6 deletions packages/webhooks-v5/commands/webhooks/deliveries/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../../lib/webhook-type.js')

class Deliveries extends Command {
async run() {
async run () {
const {flags} = this.parse(Deliveries)
let {path, display} = webhookType(flags)
let max = 1000
Expand All @@ -16,9 +16,9 @@ class Deliveries extends Command {
let {body} = await this.heroku.get(path, {
headers: {
Accept: 'application/vnd.heroku+json; version=3.webhooks',
Range: `seq ..; order=desc,max=${max}`,
Range: `seq ..; order=desc,max=${max}`
},
partial: true,
partial: true
})
let deliveries = body

Expand All @@ -45,7 +45,7 @@ class Deliveries extends Command {
{key: 'num_attempts', label: 'Attempts', get: w => String(w.num_attempts)},
{key: 'last_code', label: 'Code', get: code},
{key: 'last_error', label: 'Error', get: w => (w.last_attempt && w.last_attempt.error_class) || ''},
{key: 'next_attempt_at', label: 'Next Attempt', get: w => w.next_attempt_at || ''},
{key: 'next_attempt_at', label: 'Next Attempt', get: w => w.next_attempt_at || ''}
]})
}
}
Expand All @@ -54,13 +54,13 @@ class Deliveries extends Command {
Deliveries.description = 'list webhook deliveries on an app'

Deliveries.examples = [
'$ heroku webhooks:deliveries',
'$ heroku webhooks:deliveries'
]

Deliveries.flags = {
app: flags.app({char: 'a'}),
status: flags.string({char: 's', description: 'filter deliveries by status'}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true})
}

module.exports = Deliveries
14 changes: 7 additions & 7 deletions packages/webhooks-v5/commands/webhooks/deliveries/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../../lib/webhook-type.js')

class Info extends Command {
async run() {
async run () {
const {flags, args} = this.parse(Info)
let {path} = webhookType(flags)

let {body} = await this.heroku.get(`${path}/webhook-deliveries/${args.id}`, {
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'},
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}
})
let delivery = body

let res = await this.heroku.get(`${path}/webhook-events/${delivery.event.id}`, {
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'},
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}
})
let event = res.body

Expand All @@ -27,7 +27,7 @@ class Info extends Command {
Attempts: delivery.num_attempts,
Code: delivery.last_attempt && delivery.last_attempt.code,
Error: delivery.last_attempt && delivery.last_attempt.error_class,
'Next Attempt': delivery.next_attempt_at,
'Next Attempt': delivery.next_attempt_at
}

cli.styledHeader(delivery.id)
Expand All @@ -41,16 +41,16 @@ class Info extends Command {
Info.description = 'info for a webhook event on an app'

Info.examples = [
'$ heroku webhooks:deliveries:info 99999999-9999-9999-9999-999999999999',
'$ heroku webhooks:deliveries:info 99999999-9999-9999-9999-999999999999'
]

Info.args = [
{name: 'id'},
{name: 'id'}
]

Info.flags = {
app: flags.app({char: 'a'}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true})
}

module.exports = Info
10 changes: 5 additions & 5 deletions packages/webhooks-v5/commands/webhooks/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../../lib/webhook-type.js')

class Events extends Command {
async run() {
async run () {
const {flags} = this.parse(Events)
cli.warn('heroku webhooks:event is deprecated, please use heroku webhooks:deliveries')
let {path, display} = webhookType(flags)

let {body} = await this.heroku.get(`${path}/webhook-events`, {
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'},
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}
})
let events = body

Expand All @@ -22,7 +22,7 @@ class Events extends Command {
{key: 'id', label: 'Event ID'},
{key: 'resource', label: 'Resource', get: w => w.payload.resource},
{key: 'action', label: 'Action', get: w => w.payload.action},
{key: 'published_at', label: 'Published At', get: w => w.payload.published_at},
{key: 'published_at', label: 'Published At', get: w => w.payload.published_at}
]})
}
}
Expand All @@ -31,12 +31,12 @@ class Events extends Command {
Events.description = 'list webhook events on an app'

Events.examples = [
'$ heroku webhooks:events',
'$ heroku webhooks:events'
]

Events.flags = {
app: flags.app({char: 'a'}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true})
}

module.exports = Events
12 changes: 6 additions & 6 deletions packages/webhooks-v5/commands/webhooks/events/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../../lib/webhook-type.js')

class Info extends Command {
async run() {
async run () {
const {flags, args} = this.parse(Info)
cli.warn('heroku webhooks:event:info is deprecated, please use heroku webhooks:deliveries:info')
let {path} = webhookType(flags)

let {body} = await this.heroku.get(`${path}/webhook-events/${args.id}`, {
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'},
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}
})
let webhookEvent = body

let obj = {
payload: JSON.stringify(webhookEvent.payload, null, 2),
payload: JSON.stringify(webhookEvent.payload, null, 2)
}

cli.styledHeader(webhookEvent.id)
Expand All @@ -25,16 +25,16 @@ class Info extends Command {
Info.description = 'info for a webhook event on an app'

Info.examples = [
'$ heroku webhooks:events:info 99999999-9999-9999-9999-999999999999',
'$ heroku webhooks:events:info 99999999-9999-9999-9999-999999999999'
]

Info.flags = {
app: flags.app({char: 'a'}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true})
}

Info.args = [
{name: 'id'},
{name: 'id'}
]

module.exports = Info
10 changes: 5 additions & 5 deletions packages/webhooks-v5/commands/webhooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../lib/webhook-type.js')

class Webhooks extends Command {
async run() {
async run () {
const {flags} = this.parse(Webhooks)
let {path, display} = webhookType(flags)

let {body} = await this.heroku.get(`${path}/webhooks`, {
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'},
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}
})
let webhooks = body

Expand All @@ -23,20 +23,20 @@ class Webhooks extends Command {
{key: 'id', label: 'Webhook ID'},
{key: 'url', label: 'URL'},
{key: 'include', label: 'Include'},
{key: 'level', label: 'Level'},
{key: 'level', label: 'Level'}
]})
}
}

Webhooks.description = 'list webhooks on an app'

Webhooks.examples = [
'$ heroku webhooks',
'$ heroku webhooks'
]

Webhooks.flags = {
app: flags.app({char: 'a'}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true})
}

module.exports = Webhooks
12 changes: 6 additions & 6 deletions packages/webhooks-v5/commands/webhooks/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ const cli = require('heroku-cli-util')
const webhookType = require('../../lib/webhook-type.js')

class Info extends Command {
async run() {
async run () {
const {flags, args} = this.parse(Info)
let {path} = webhookType(flags)

let {body} = await this.heroku.get(`${path}/webhooks/${args.id}`, {
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'},
headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}
})
let webhook = body

let obj = {
'Webhook ID': webhook.id,
URL: webhook.url,
Include: webhook.include.join(','),
Level: webhook.level,
Level: webhook.level
}

cli.styledHeader(webhook.id)
Expand All @@ -27,16 +27,16 @@ class Info extends Command {
Info.description = 'info for a webhook on an app'

Info.examples = [
'$ heroku webhooks:info 99999999-9999-9999-9999-999999999999',
'$ heroku webhooks:info 99999999-9999-9999-9999-999999999999'
]

Info.flags = {
app: flags.app({char: 'a'}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}),
pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true})
}

Info.args = [
{name: 'id'},
{name: 'id'}
]

module.exports = Info
Loading

0 comments on commit f12acda

Please sign in to comment.