From 1230872525bf0eb4fb18d1211a89f7cb124e1d24 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 23 Sep 2026 18:08:18 +0200 Subject: [PATCH] CI: Use rubocop rake task This is the default in all of our repos and it provides proper github annotations. Signed-off-by: Tim Meusel --- .github/workflows/runtime_tests.yml | 2 +- Rakefile | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/runtime_tests.yml b/.github/workflows/runtime_tests.yml index a3a2d569..687acf98 100644 --- a/.github/workflows/runtime_tests.yml +++ b/.github/workflows/runtime_tests.yml @@ -28,7 +28,7 @@ jobs: ruby-version: 4.0 bundler-cache: true - name: Run rubocop - run: bundle exec rubocop + run: bundle exec rake rubocop - name: Vanagon inspect run: | stat=0 diff --git a/Rakefile b/Rakefile index f475e882..b4a68ddf 100644 --- a/Rakefile +++ b/Rakefile @@ -25,4 +25,17 @@ def run_command(cmd, silent: true, print_command: false, report_status: false) output.chomp end +begin + require 'rubocop/rake_task' +rescue LoadError + # Do nothing if no required gem installed +else + RuboCop::RakeTask.new(:rubocop) do |task| + # These make the rubocop experience maybe slightly less terrible + task.options = ['--display-cop-names', '--display-style-guide', '--extra-details'] + # Use Rubocop's Github Actions formatter if possible + task.formatters << 'github' if ENV['GITHUB_ACTIONS'] == 'true' + end +end + Dir.glob(File.join('tasks/**/*.rake')).each { |file| load file }