Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib/example/circle_ci
test
.gitignore
.rubocop.yml
.tachikoma.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE.txt
README.md
Rakefile
circle.yml
example-circle_ci-pull_request_review.gemspec

README.md

Example::CircleCi::PullRequestReview

run rubocop and pull request review comment

Actual script for CircleCI

# circle.yml
test:
  pre:
    - bin/run-rubocop.sh

# bin/run-rubocop.sh
#!/bin/bash
set -v
if [ "${CIRCLE_BRANCH}" != "master" ]; then
  gem install --no-document rubocop-select rubocop rubocop-checkstyle_formatter \
              checkstyle_filter-git saddler saddler-reporter-github

  git diff -z --name-only origin/master \
   | xargs -0 rubocop-select \
   | xargs rubocop \
       --require rubocop/formatter/checkstyle_formatter \
       --format RuboCop::Formatter::CheckstyleFormatter \
   | checkstyle_filter-git diff origin/master \
   | saddler report \
      --require saddler/reporter/github \
      --reporter Saddler::Reporter::Github::PullRequestReviewComment
fi
exit 0

If you prefer to exec post test, you can set this. See: Configuring CircleCI - CircleCI

Setting

Environment variables - CircleCI

set your own GITHUB_ACCESS_TOKEN

Contributing

  1. Fork it ( https://github.com/packsaddle/example-circle_ci-pull_request_review/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request