General cleanup (#350)

* re-order args for `bin/probot-run.js`
 - Local tunnel/internal properties are grouped together and appear first
  - GitHub App args are now grouped together and come second

* standardize on block comment spacing in `lib/robot.js`
  - open comment is flush
  - all subsequent lines are indented by 1-space
This commit is contained in:
Jamie Jones 2017-11-26 21:42:04 -05:00 committed by GitHub
parent 01b347c9c4
commit a7596e24d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 18 deletions

View File

@ -9,12 +9,12 @@ const {findPrivateKey} = require('../lib/private-key')
program program
.usage('[options] <apps...>') .usage('[options] <apps...>')
.option('-p, --port <n>', 'Port to start the server on', process.env.PORT || 3000)
.option('-t, --tunnel <subdomain>', 'Expose your local bot to the internet', process.env.SUBDOMAIN || process.env.NODE_ENV !== 'production')
.option('-w, --webhook-path <path>', 'URL path which receives webhooks. Ex: `/webhook`', process.env.WEBHOOK_PATH)
.option('-a, --app <id>', 'ID of the GitHub App', process.env.APP_ID) .option('-a, --app <id>', 'ID of the GitHub App', process.env.APP_ID)
.option('-s, --secret <secret>', 'Webhook secret of the GitHub App', process.env.WEBHOOK_SECRET) .option('-s, --secret <secret>', 'Webhook secret of the GitHub App', process.env.WEBHOOK_SECRET)
.option('-p, --port <n>', 'Port to start the server on', process.env.PORT || 3000)
.option('-P, --private-key <file>', 'Path to certificate of the GitHub App', findPrivateKey) .option('-P, --private-key <file>', 'Path to certificate of the GitHub App', findPrivateKey)
.option('-w, --webhook-path <path>', 'URL path which receives webhooks. Ex: `/webhook`', process.env.WEBHOOK_PATH)
.option('-t, --tunnel <subdomain>', 'Expose your local bot to the internet', process.env.SUBDOMAIN || process.env.NODE_ENV !== 'production')
.parse(process.argv) .parse(process.argv)
if (!program.app) { if (!program.app) {

View File

@ -177,21 +177,21 @@ function rateLimitedClient (github) {
module.exports = (...args) => new Robot(...args) module.exports = (...args) => new Robot(...args)
/** /**
* Do the thing * Do the thing
* @callback Robot~webhookCallback * @callback Robot~webhookCallback
* @param {Context} context - the context of the event that was triggered, * @param {Context} context - the context of the event that was triggered,
* including `context.payload`, and helpers for extracting information from * including `context.payload`, and helpers for extracting information from
* the payload, which can be passed to GitHub API calls. * the payload, which can be passed to GitHub API calls.
* *
* ```js * ```js
* module.exports = robot => { * module.exports = robot => {
* robot.on('push', context => { * robot.on('push', context => {
* // Code was pushed to the repo, what should we do with it? * // Code was pushed to the repo, what should we do with it?
* robot.log(context); * robot.log(context);
* }); * });
* }; * };
* ``` * ```
*/ */
/** /**
* A [GitHub webhook event](https://developer.github.com/webhooks/#events) payload * A [GitHub webhook event](https://developer.github.com/webhooks/#events) payload