Skip to content

fix: require cookstyle/chefstyle so style checks actually run - #43

Merged
tas50 merged 1 commit into
mainfrom
chore/cookstyle-chefstyle
Aug 24, 2026
Merged

tas50 merged 1 commit into
mainfrom
chore/cookstyle-chefstyle

Conversation

@tas50

@tas50 tas50 commented Aug 24, 2026

Copy link
Copy Markdown
Member

The Rakefile requires the standalone chefstyle gem:

begin
  require "chefstyle"
  require "rubocop/rake_task"
  RuboCop::RakeTask.new(:style) { ... }
rescue LoadError
  puts "chefstyle is not available. ..."
end

but chefstyle appears in neither the Gemfile nor the gemspec — the :cookstyle group declares cookstyle and nothing else. The require therefore falls into the rescue LoadError branch, the :style task is never defined, and style checking silently does not happen.

Chefstyle was absorbed into Cookstyle, which ships the rule set as cookstyle/chefstyle (it sets CHEFSTYLE_CONFIG = true and then loads cookstyle). Requiring that path uses the gem that is actually installed. kitchen-pester's Rakefile already does exactly this.

Expect rake style to start reporting offenses that were previously going unchecked.

The Rakefile required the standalone chefstyle gem, which is not in the
bundle -- only cookstyle is. The require therefore hit the LoadError
branch and the :style task was never defined.

Signed-off-by: Tim Smith <tsmith84@proton.me>
@tas50
tas50 merged commit 8b8d6b4 into main Aug 24, 2026
8 checks passed
@tas50
tas50 deleted the chore/cookstyle-chefstyle branch August 24, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant