diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 724faebb..b81b9e7e 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -54,10 +54,3 @@ steps: docker: image: ruby:3.1 -- label: chefstyle-tests-ruby-3.1 - command: - - .expeditor/run_linux_tests.sh "rake style:chefstyle" - expeditor: - executor: - docker: - image: ruby:3.1 diff --git a/.rubocop.yml b/.rubocop.yml index 62ed74a2..7c47aa4c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,24 +1,24 @@ ---- -require: - - chefstyle - AllCops: TargetRubyVersion: 3.1 Include: - - "**/*.rb" + - "**/*.rb" Exclude: - - "vendor/**/*" - - "spec/**/*" + - "vendor/**/*" + - "spec/**/*" + Style/StringLiterals: Exclude: - "spec/unit/fixtures/**/*" - "lib/chef-cli/skeletons/**/*" + Layout/TrailingWhitespace: Exclude: - "spec/unit/fixtures/**/*" + Style/PercentLiteralDelimiters: Exclude: - "lib/chef-cli/skeletons/**/*" + Layout/TrailingEmptyLines: Exclude: - "spec/unit/fixtures/**/*" diff --git a/Gemfile b/Gemfile index d7097f9e..8b3a32bd 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,6 @@ group :test do gem "rspec-expectations", "~> 3.8" gem "rspec-mocks", "~> 3.8" gem "cookstyle" - gem "chefstyle" gem "faraday_middleware" gem "chef-test-kitchen-enterprise", git: "https://github.com/chef/chef-test-kitchen-enterprise", branch: "main" gem "simplecov", require: false diff --git a/Rakefile b/Rakefile index f25cfd7f..4b823da0 100644 --- a/Rakefile +++ b/Rakefile @@ -19,6 +19,7 @@ require "bundler/gem_tasks" namespace :style do begin + require "cookstyle/chefstyle" require "rubocop/rake_task" desc "Run Cookbook Ruby style checks" @@ -30,28 +31,5 @@ namespace :style do rescue LoadError => e puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV["CI"] end - - begin - require "rubocop/rake_task" - - ignore_dirs = Regexp.union(%w{ - lib/chef-cli/skeletons/code_generator - spec/unit/fixtures/chef-runner-cookbooks - spec/unit/fixtures/cookbook_cache - spec/unit/fixtures/example_cookbook - spec/unit/fixtures/example_cookbook_metadata_json_only - spec/unit/fixtures/example_cookbook_no_metadata - spec/unit/fixtures/local_path_cookbooks - }) - - desc "Run Chef Ruby style checks" - RuboCop::RakeTask.new(:chefstyle) do |t| - t.requires = ["chefstyle"] - t.patterns = `rubocop --list-target-files`.split("\n").reject { |f| f =~ ignore_dirs } - t.options = ["--display-cop-names"] - end - rescue LoadError => e - puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV["CI"] - end end