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 }