summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-02 12:39:33 -0800
committerGitHub <noreply@github.com>2021-02-02 12:39:33 -0800
commitabaae6a5619cce53a71c8040eec0248252145223 (patch)
tree209e18e1a11c4ed76c6904055a4aefca96916dc1
parentd889045f37d9695cce6aa2ccc4675822588f171c (diff)
parentce2f59a3ef20c7eb3136cfc941a537542f700e9d (diff)
downloadchef-abaae6a5619cce53a71c8040eec0248252145223.tar.gz
Merge pull request #10967 from chef/error_message
Fix an interpolation mistake in an error message + turn on the cop
-rw-r--r--.rubocop.yml5
-rw-r--r--lib/chef/util/dsc/configuration_generator.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 0270949244..b88ed74196 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -30,6 +30,11 @@ Lint/IneffectiveAccessModifier:
Enabled: false
Lint/ShadowedException:
Enabled: false
+Lint/InterpolationCheck:
+ Enabled: true
+ Exclude:
+ - 'spec/unit/property_spec.rb'
+ - 'spec/functional/shell_spec.rb'
# set additional paths
Chef/Ruby/UnlessDefinedRequire:
diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb
index 7e78e1ecab..5cf58d612e 100644
--- a/lib/chef/util/dsc/configuration_generator.rb
+++ b/lib/chef/util/dsc/configuration_generator.rb
@@ -105,7 +105,7 @@ class Chef::Util::DSC
# The name may not be null or empty, and should start with a letter.
def validate_configuration_name!(configuration_name)
if !!(configuration_name =~ /\A[A-Za-z]+[_a-zA-Z0-9]*\Z/) == false
- raise ArgumentError, 'Configuration `#{configuration_name}` is not a valid PowerShell cmdlet name'
+ raise ArgumentError, "Configuration `#{configuration_name}` is not a valid PowerShell cmdlet name"
end
end