summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-01-15 13:14:06 -0800
committerTim Smith <tsmith84@gmail.com>2021-01-15 13:24:46 -0800
commitbf9ec02fa6eda80c7278c5c0feeee3b60d309bed (patch)
tree7018d2648a4ddb3af97ff9070ac42be8d5353961
parent7efa1780adddd87dae1a5b550959de618b27492f (diff)
downloadchef-bf9ec02fa6eda80c7278c5c0feeee3b60d309bed.tar.gz
Split out the rubocop runs so we can bump to 2.7rubocop_tweaks
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.expeditor/verify.pipeline.yml6
-rw-r--r--.rubocop.yml9
-rw-r--r--chef-config/.rubocop.yml7
-rw-r--r--chef-config/Gemfile1
-rw-r--r--chef-utils/.rubocop.yml7
-rw-r--r--chef-utils/Gemfile1
-rw-r--r--chef-utils/spec/unit/dsl/platform_family_spec.rb4
7 files changed, 26 insertions, 9 deletions
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
index 661017c0c1..cc539a684f 100644
--- a/.expeditor/verify.pipeline.yml
+++ b/.expeditor/verify.pipeline.yml
@@ -15,23 +15,25 @@ steps:
# Tests Ruby 2.6
#########################################################################
-- label: "chef-utils Unit :ruby: 2.6"
+- label: "chef-utils Unit / Style :ruby: 2.6"
commands:
- /workdir/.expeditor/scripts/bk_container_prep.sh
- cd chef-utils
- bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec
+ - bundle exec chefstyle .
expeditor:
executor:
docker:
image: rubydistros/ubuntu-18.04:2.6
-- label: "chef-config Unit :ruby: 2.6"
+- label: "chef-config Unit / Style :ruby: 2.6"
commands:
- /workdir/.expeditor/scripts/bk_container_prep.sh
- cd chef-config
- bundle install --jobs=3 --retry=3 --path=vendor/bundle --without omnibus_package
- bundle exec rake spec
+ - bundle exec chefstyle .
expeditor:
executor:
docker:
diff --git a/.rubocop.yml b/.rubocop.yml
index eb41ed78fa..aa138bb28f 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,10 +1,11 @@
AllCops:
- TargetRubyVersion: 2.6
+ TargetRubyVersion: 2.7
Exclude:
- "spec/data/**/*"
- "vendor/**/*"
- "pkg/**/*"
- - "chef-config/pkg/**/*"
+ - "chef-config/**/*"
+ - "chef-utils/**/*"
- "habitat/**/*"
Security/Eval:
Enabled: false
@@ -27,6 +28,4 @@ Lint/IneffectiveAccessModifier:
Chef/Ruby/UnlessDefinedRequire:
Include:
- 'lib/**/*'
- - 'chef-bin/**/*'
- - 'chef-config/lib/**/*'
- - 'chef-utils/lib/**/*'
+ - 'chef-bin/**/*' \ No newline at end of file
diff --git a/chef-config/.rubocop.yml b/chef-config/.rubocop.yml
new file mode 100644
index 0000000000..1d1b2faf6d
--- /dev/null
+++ b/chef-config/.rubocop.yml
@@ -0,0 +1,7 @@
+AllCops:
+ TargetRubyVersion: 2.6
+
+# set additional paths
+Chef/Ruby/UnlessDefinedRequire:
+ Include:
+ - 'lib/**/*' \ No newline at end of file
diff --git a/chef-config/Gemfile b/chef-config/Gemfile
index 4498154338..0fe8bccef8 100644
--- a/chef-config/Gemfile
+++ b/chef-config/Gemfile
@@ -7,4 +7,5 @@ gemspec
group(:development, :test) do
gem "rake"
gem "rspec"
+ gem "chefstyle"
end
diff --git a/chef-utils/.rubocop.yml b/chef-utils/.rubocop.yml
new file mode 100644
index 0000000000..1d1b2faf6d
--- /dev/null
+++ b/chef-utils/.rubocop.yml
@@ -0,0 +1,7 @@
+AllCops:
+ TargetRubyVersion: 2.6
+
+# set additional paths
+Chef/Ruby/UnlessDefinedRequire:
+ Include:
+ - 'lib/**/*' \ No newline at end of file
diff --git a/chef-utils/Gemfile b/chef-utils/Gemfile
index 2555cf15d9..9792c93aa6 100644
--- a/chef-utils/Gemfile
+++ b/chef-utils/Gemfile
@@ -7,4 +7,5 @@ group(:development, :test) do
gem "fauxhai-ng"
gem "rake"
gem "rspec"
+ gem "chefstyle"
end \ No newline at end of file
diff --git a/chef-utils/spec/unit/dsl/platform_family_spec.rb b/chef-utils/spec/unit/dsl/platform_family_spec.rb
index fdf4584afd..0c411b2c44 100644
--- a/chef-utils/spec/unit/dsl/platform_family_spec.rb
+++ b/chef-utils/spec/unit/dsl/platform_family_spec.rb
@@ -162,7 +162,7 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
end
context "on oracle7" do
- let(:options) { { platform: "oracle", version: "7.6" } }
+ let(:options) { { platform: "oracle", version: "7" } }
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
end
@@ -174,7 +174,7 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
end
context "on redhat7" do
- let(:options) { { platform: "redhat", version: "7.6" } }
+ let(:options) { { platform: "redhat", version: "7" } }
pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
end