Run rubocop via Rakefile
This commit is contained in:
parent
2b26a3aa0e
commit
948ab8604b
2 changed files with 8 additions and 3 deletions
4
.github/workflows/rubocop.yml
vendored
4
.github/workflows/rubocop.yml
vendored
|
@ -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 ]]
|
||||
"
|
||||
|
||||
|
|
7
Rakefile
7
Rakefile
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue