From 99617b3772e2bb538bfa1999acee10a8daf829b0 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Sat, 27 Jun 2026 22:22:17 -0700 Subject: [PATCH] Run cookstyle via Bundler in CI and fix rubocop target Ruby The lint workflow installed cookstyle ad hoc with `gem install cookstyle`, which floats to the latest release and can diverge from the version the project actually develops against. Use the gemspec-pinned cookstyle (`~> 8.4`) by enabling bundler-cache and running `bundle exec cookstyle` so CI and local `rake style` stay in lockstep. Also bump `.rubocop.yml` TargetRubyVersion from 2.5 to 3.1 to match the gemspec's `required_ruby_version >= 3.1`; 2.5 silently disabled cops for the Ruby versions the project supports. Signed-off-by: Tim Smith --- .github/workflows/lint.yml | 7 ++----- .rubocop.yml | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 80f6b5ba..b1b226a7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,9 +19,6 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 - bundler-cache: false + bundler-cache: true - uses: r7kamura/rubocop-problem-matchers-action@v1 # this shows the failures in the PR - - run: | - gem install cookstyle - cookstyle --chefstyle -c .rubocop.yml - \ No newline at end of file + - run: bundle exec cookstyle --chefstyle -c .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml index 78ced549..a1e46ef5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,5 @@ AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 Exclude: - "examples/**/*" - "spec/tmp/**/*"