Run rubocop via Rakefile

This commit is contained in:
Sven Weidauer 2022-05-29 10:20:33 +02:00
parent 2b26a3aa0e
commit 948ab8604b
2 changed files with 8 additions and 3 deletions

View file

@ -25,8 +25,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
# If running on a self-hosted runner, check it meets the requirements
# listed at https://github.com/ruby/setup-ruby#using-self-hosted-runners
- name: Set up Ruby
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
with:
@ -38,7 +36,7 @@ jobs:
- name: Rubocop run
run: |
bash -c "
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
bundle exec rake lint_github
[[ $? -ne 2 ]]
"

View file

@ -14,3 +14,10 @@ require 'rubocop/rake_task'
desc 'Run RuboCop'
RuboCop::RakeTask.new(:lint)
desc 'Run RuboCop for GitHub'
RuboCop::RakeTask.new(:lint_github) do |t|
t.requires << 'code_scanning'
t.formatters << 'CodeScanning::SarifFormatter'
t.options << '-o' << 'rubocop.sarif'
end