Skip to content

Commit 68ccf64

Browse files
authored
Merge pull request #6 from RadiusNetworks/use-review-dog
Add service integration for review 🐶 check
2 parents 1589c19 + 7448ea1 commit 68ccf64

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ before_install:
55
- gem update --system
66
- gem install bundler
77
bundler_args: --jobs=3 --retry=3 --without documentation debug
8+
before_script:
9+
- "bin/ci-code-review"
810
script: bin/ci
911
rvm:
1012
- 2.5

bin/ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ bundle-audit check --update
2020

2121
# Run style checker
2222
echo " ---> Running rubocop"
23-
bin/rubocop --extra-details --display-style-guide
23+
bin/rubocop --extra-details --display-style-guide --lint

bin/ci-code-review

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# See:
4+
# - https://docs.travis-ci.com/user/environment-variables/#Convenience-Variables
5+
# - https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
6+
# - https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
7+
if [[ "$TRAVIS_PULL_REQUEST" = "false" ]] || [[ "$TRAVIS_BRANCH" = "production" ]]; then
8+
exit
9+
fi
10+
11+
set -e
12+
cd "$(dirname "$0")/.."
13+
14+
REVIEWDOG_VERSION="0.9.9"
15+
16+
if ! [ "$(./bin/reviewdog -version)" = "$REVIEWDOG_VERSION" ]; then
17+
echo "Installing reviewdog version ${REVIEWDOG_VERSION}..."
18+
curl -fsSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 \
19+
-o ./bin/reviewdog
20+
chmod +x ./bin/reviewdog
21+
fi
22+
23+
echo Rubocop Version: $(./bin/rubocop --version)
24+
echo Review Dog Version: $(./bin/reviewdog -version)
25+
26+
# Add `-diff="git diff master"` to reviewdog args when running locally
27+
./bin/rubocop --config .rubocop.yml --extra-details --display-style-guide --rails | \
28+
./bin/reviewdog -f=rubocop -reporter=github-pr-check

0 commit comments

Comments
 (0)