From 32f7971b4fa002cdc36057013f06bfd44493778c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mindaugas=20Moz=C5=ABras?= Date: Tue, 7 Oct 2014 21:06:16 +0300 Subject: [PATCH] Update README --- README.md | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ce591b29..fea2436c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Inline docs](http://inch-ci.org/github/mmozuras/pronto.png)](http://inch-ci.org/github/mmozuras/pronto) Pronto runs analysis quickly by checking only the relevant changes. Created to -be used on pull requests, but suited for other scenarios as well. Perfect if you +be used on pull requests, but also suited for other scenarios. Perfect if you want to find out quickly if branch introduces changes that conform to your [styleguide](https://github.com/mmozuras/pronto-rubocop), [are DRY](https://github.com/mmozuras/pronto-flay), [don't introduce security holes](https://github.com/mmozuras/pronto-brakeman) and [more](#runners). @@ -20,49 +20,55 @@ Pronto runs the checks on a diff between the current HEAD and the provided commi ### GitHub Integration You can run Pronto as a step of your CI builds and get the results as comments -on GitHub commits using `GithubFormatter`. +on GitHub commits using `GithubFormatter` or `GithubPullRequestFormatter`. Add Pronto runners you want to use to your Gemfile: ```ruby - gem 'pronto-rubocop' +gem 'pronto-rubocop' ``` or gemspec file: ```ruby - s.add_development_dependency 'pronto-rubocop' +s.add_development_dependency 'pronto-rubocop' ``` -Set the GITHUB_ACCESS_TOKEN environment variable to [OAuth token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) -that has access to the repository. Then set up a rake task: -```ruby - Pronto.gem_names.each { |gem_name| require "pronto/#{gem_name}" } +Set the GITHUB_ACCESS_TOKEN environment variable to [OAuth token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) +that has access to the repository. - formatter = Pronto::Formatter::GithubFormatter.new - Pronto.run('origin/master', '.', formatter) +Then just run it: +```bash +GITHUB_ACCESS_TOKEN=token pronto run -f github -c origin/master ``` -or run it via command line: +or, if you want comments to appear on pull request diff, instead of commit: +```bash +GITHUB_ACCESS_TOKEN=token PULL_REQUEST_ID=id pronto run -f github_pr -c origin/master ``` - GITHUB_ACCESS_TOKEN= bundle exec pronto run -f github -c origin/master + +As an alternative, you can also set up a rake task: +```ruby +Pronto.gem_names.each { |gem_name| require "pronto/#{gem_name}" } + +formatter = Pronto::Formatter::GithubFormatter.new # or GithubPullRequestFormatter +Pronto.run('origin/master', '.', formatter) ``` ### Local Changes You can run Pronto locally. First, install Pronto and the runners you want to use: ```bash - gem install pronto - gem install pronto-rubocop +gem install pronto +gem install pronto-rubocop ``` Then navigate to the repository you want to run Pronto on, and: ```bash - git checkout feature/branch - pronto run # Pronto runs against master by default +git checkout feature/branch +pronto run # Pronto runs against master by default ``` -Run `pronto` in your terminal without any arguments to see what more Pronto is -capable off. +Just run `pronto` without any arguments to see what Pronto is capable off. ## Runners Pronto can run various tools and libraries, as long as there's a runner for it. -Currently available runners: +Currently available: * [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop) * [pronto-flay](https://github.com/mmozuras/pronto-flay)