Skip to content

Commit 49a0309

Browse files
committed
Add git-diff for rubocop in pipeline
1 parent 017f906 commit 49a0309

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ rubocop:
3434
- .bundle
3535
stage: lint
3636
script:
37-
- bundle exec rubocop | tee output || exit_code=$?
37+
- rubocop_exit_code=0; git_exit_code=0
38+
- bundle exec rubocop -A | tee output || rubocop_exit_code=$?
39+
- git diff --exit-code || git_exit_code=$?
3840
- |
3941
echo -e "\e[0Ksection_start:`date +%s`:glpa_summary\r\e[0KHeader of the summary"
4042
grep -E '[[:digit:]] files inspected, ' output
4143
echo -e "\e[0Ksection_end:`date +%s`:glpa_summary\r\e[0K"
42-
exit $exit_code
44+
exit $(($rubocop_exit_code + $git_exit_code))
4345
4446
graphql_docs:
4547
extends:

0 commit comments

Comments
 (0)