diff --git a/.rubocop.yml b/.rubocop.yml index b8368d2e4..08595d6b4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,4 +9,8 @@ Style/HashEachMethods: # ChefModernize/FoodcriticComments itslef include an example Foocritic comment which alerts ChefModernize/FoodcriticComments: - Enabled: false \ No newline at end of file + Enabled: false + +# reduces memory usage +Style/FrozenStringLiteralComment: + Enabled: true \ No newline at end of file diff --git a/Gemfile b/Gemfile index 99f2bcab3..0f8910d0e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'https://rubygems.org' # Specify your gem's dependencies in cookstyle.gemspec diff --git a/Rakefile b/Rakefile index 51302ac1f..4e1cfde98 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'bundler/gem_tasks' Dir['tasks/**/*.rake'].each { |t| load t } diff --git a/bin/cookstyle b/bin/cookstyle index 0d376c78e..677d98dcb 100755 --- a/bin/cookstyle +++ b/bin/cookstyle @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # -*- encoding: utf-8 -*- +# frozen_string_literal: true $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w(.. lib)) diff --git a/bin/cookstyle-profile b/bin/cookstyle-profile new file mode 100755 index 000000000..264e697a5 --- /dev/null +++ b/bin/cookstyle-profile @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +if ARGV.include?('-h') || ARGV.include?('--help') + puts 'Usage: same as main `cookstyle` command but gathers profiling info' + puts 'Additional option: `--memory` to print memory usage' + exit(0) +end +with_mem = ARGV.delete('--memory') + +require 'stackprof' +if with_mem + require 'memory_profiler' + MemoryProfiler.start +end +StackProf.start +start = Process.clock_gettime(Process::CLOCK_MONOTONIC) +begin + load "#{__dir__}/cookstyle" +ensure + delta = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start + puts "Finished in #{delta.round(1)} seconds" + StackProf.stop + if with_mem + puts 'Building memory report...' + report = MemoryProfiler.stop + end + Dir.mkdir('tmp') unless File.exist?('tmp') + StackProf.results('tmp/stackprof.dump') + report&.pretty_print(scale_bytes: true) +end diff --git a/cookstyle.gemspec b/cookstyle.gemspec index 2e5e75ba9..8e79cfb95 100644 --- a/cookstyle.gemspec +++ b/cookstyle.gemspec @@ -1,4 +1,5 @@ # coding: utf-8 +# frozen_string_literal: true lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'cookstyle/version' diff --git a/lib/cookstyle.rb b/lib/cookstyle.rb index b16649e9e..d3de4f774 100644 --- a/lib/cookstyle.rb +++ b/lib/cookstyle.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative 'cookstyle/version' require 'pathname' diff --git a/lib/cookstyle/version.rb b/lib/cookstyle/version.rb index f8c0e20e7..2bc987fd9 100644 --- a/lib/cookstyle/version.rb +++ b/lib/cookstyle/version.rb @@ -1,4 +1,5 @@ +# frozen_string_literal: true module Cookstyle - VERSION = "6.12.3".freeze # rubocop: disable Style/StringLiterals - RUBOCOP_VERSION = '0.87.1'.freeze + VERSION = "6.12.3" # rubocop: disable Style/StringLiterals + RUBOCOP_VERSION = '0.87.1' end diff --git a/lib/rubocop/chef.rb b/lib/rubocop/chef.rb index 3d3694378..ae5ed0c81 100755 --- a/lib/rubocop/chef.rb +++ b/lib/rubocop/chef.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module RuboCop # RuboCop Chef project namespace module Chef diff --git a/lib/rubocop/chef/autocorrect_helpers.rb b/lib/rubocop/chef/autocorrect_helpers.rb index a86d8db89..097257d57 100644 --- a/lib/rubocop/chef/autocorrect_helpers.rb +++ b/lib/rubocop/chef/autocorrect_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/lib/rubocop/chef/cookbook_helpers.rb b/lib/rubocop/chef/cookbook_helpers.rb index d098573b4..428cfd7c9 100644 --- a/lib/rubocop/chef/cookbook_helpers.rb +++ b/lib/rubocop/chef/cookbook_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/lib/rubocop/chef/platform_helpers.rb b/lib/rubocop/chef/platform_helpers.rb index fb3a700aa..f59a95f00 100644 --- a/lib/rubocop/chef/platform_helpers.rb +++ b/lib/rubocop/chef/platform_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb b/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb index f1d9a4366..cc71a467f 100644 --- a/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +++ b/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ module ChefCorrectness # end # class BlockGuardWithOnlyString < Cop - MSG = 'A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it be executed as Ruby code which will always returns true instead of a shell command that will actually run.'.freeze + MSG = 'A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it be executed as Ruby code which will always returns true instead of a shell command that will actually run.' def_node_matcher :block_guard_with_only_string?, <<-PATTERN (block (send nil? ${:not_if :only_if}) (args) (str $_) ) diff --git a/lib/rubocop/cop/chef/correctness/cb_depends_on_self.rb b/lib/rubocop/cop/chef/correctness/cb_depends_on_self.rb index a9fb42d35..666b1e626 100644 --- a/lib/rubocop/cop/chef/correctness/cb_depends_on_self.rb +++ b/lib/rubocop/cop/chef/correctness/cb_depends_on_self.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefCorrectness class CookbooksDependsOnSelf < Cop include RangeHelp - MSG = 'A cookbook cannot depend on itself. This will fail on Chef Infra Client 13+'.freeze + MSG = 'A cookbook cannot depend on itself. This will fail on Chef Infra Client 13+' def_node_search :dependencies, '(send nil? :depends str ...)' def_node_matcher :cb_name?, '(send nil? :name str ...)' diff --git a/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb b/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb index 61c542e1b..e0cd76cc4 100644 --- a/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +++ b/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefCorrectness # raise "Something horrible happened!" # class ChefApplicationFatal < Cop - MSG = 'Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal'.freeze + MSG = 'Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal' def_node_matcher :application_fatal?, <<-PATTERN (send diff --git a/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb b/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb index 03f2d5231..450bab3de 100644 --- a/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +++ b/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -41,7 +42,7 @@ module ChefCorrectness # class ConditionalRubyShellout < Cop include RuboCop::Chef::CookbookHelpers - MSG = "Don't use Ruby to shellout in an only_if / not_if conditional when you can shellout directly by wrapping the command in quotes.".freeze + MSG = "Don't use Ruby to shellout in an only_if / not_if conditional when you can shellout directly by wrapping the command in quotes." def_node_matcher :conditional_shellout?, <<-PATTERN (block diff --git a/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb b/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb index ef661d779..e07a32bb4 100644 --- a/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +++ b/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ class DnfPackageAllowDowngrades < Cop include RangeHelp include RuboCop::Chef::CookbookHelpers - MSG = 'dnf_package does not support the allow_downgrades property'.freeze + MSG = 'dnf_package does not support the allow_downgrades property' def on_block(node) match_property_in_resource?(:dnf_package, :allow_downgrades, node) do |prop| diff --git a/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb b/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb index 883c521e6..11a5a3c1e 100644 --- a/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +++ b/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefCorrectness # ::Chef::DSL::Recipe.send(:include, Filebeat::Helpers) # covers previous Recipe & Provider classes # class IncorrectLibraryInjection < Cop - MSG = 'Libraries should be injected into the Chef::DSL::Recipe class and not Chef::Recipe or Chef::Provider classes directly.'.freeze + MSG = 'Libraries should be injected into the Chef::DSL::Recipe class and not Chef::Recipe or Chef::Provider classes directly.' def_node_matcher :legacy_class_sends?, <<-PATTERN (send (const (const (cbase) :Chef) {:Recipe :Provider}) :send (sym :include) ... ) diff --git a/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb b/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb index 915e09b3f..457850d42 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ module ChefCorrectness # end # class InvalidNotificationTiming < Cop - MSG = 'Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.'.freeze + MSG = 'Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.' def_node_matcher :notification_with_timing?, <<-PATTERN (send nil? {:notifies :subscribes} (sym _) (...) $(sym _)) diff --git a/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb b/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb index 172f08b0b..4424bfac2 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefCorrectness class InvalidPlatformFamilyHelper < Cop include ::RuboCop::Chef::PlatformHelpers - MSG = 'Pass valid platform families to the platform_family? helper.'.freeze + MSG = 'Pass valid platform families to the platform_family? helper.' def_node_matcher :platform_family_helper?, <<-PATTERN (send nil? :platform_family? $str*) diff --git a/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb b/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb index a822bae2e..3a19b9656 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ class InvalidPlatformFamilyInCase < Cop include RangeHelp include ::RuboCop::Chef::PlatformHelpers - MSG = 'Use valid platform family values in case statements.'.freeze + MSG = 'Use valid platform family values in case statements.' def_node_matcher :node_platform_family?, <<-PATTERN (send (send nil? :node) :[] (str "platform_family") ) diff --git a/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb b/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb index 8fe49d551..84eeca9a8 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefCorrectness class InvalidPlatformHelper < Cop include ::RuboCop::Chef::PlatformHelpers - MSG = 'Pass valid platforms to the platform? helper.'.freeze + MSG = 'Pass valid platforms to the platform? helper.' def_node_matcher :platform_helper?, <<-PATTERN (send nil? :platform? $str*) diff --git a/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb b/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb index ef95eabcb..38e57706b 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefCorrectness class InvalidPlatformMetadata < Cop include ::RuboCop::Chef::PlatformHelpers - MSG = 'metadata.rb "supports" platform is invalid'.freeze + MSG = 'metadata.rb "supports" platform is invalid' def_node_matcher :supports?, '(send nil? :supports $str ...)' diff --git a/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb b/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb index 33eea36d1..93b47e393 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ class InvalidPlatformInCase < Cop include RangeHelp include ::RuboCop::Chef::PlatformHelpers - MSG = 'Use valid platform values in case statements.'.freeze + MSG = 'Use valid platform values in case statements.' def_node_matcher :node_platform?, <<-PATTERN (send (send nil? :node) :[] (str "platform") ) diff --git a/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb b/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb index 3d5c43dc7..4dda962e4 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ module ChefCorrectness class InvalidPlatformValueForPlatformFamilyHelper < Cop include ::RuboCop::Chef::PlatformHelpers - MSG = 'Pass valid platform families to the value_for_platform_family helper.'.freeze + MSG = 'Pass valid platform families to the value_for_platform_family helper.' def_node_matcher :value_for_platform_family?, <<-PATTERN (send nil? :value_for_platform_family diff --git a/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb b/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb index dee11d8d5..d0ddc1097 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ module ChefCorrectness class InvalidPlatformValueForPlatformHelper < Cop include ::RuboCop::Chef::PlatformHelpers - MSG = 'Pass valid platforms to the value_for_platform helper.'.freeze + MSG = 'Pass valid platforms to the value_for_platform helper.' def_node_matcher :value_for_platform?, <<-PATTERN (send nil? :value_for_platform diff --git a/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb b/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb index 3a3b4e2d2..283c03168 100644 --- a/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +++ b/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefCorrectness # version '1.2.3' # class InvalidVersionMetadata < Cop - MSG = 'Cookbook metadata.rb version field should follow X.Y.Z version format.'.freeze + MSG = 'Cookbook metadata.rb version field should follow X.Y.Z version format.' def_node_matcher :version?, '(send nil? :version $str ...)' diff --git a/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb b/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb index 8f4c0b558..414f166e2 100644 --- a/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +++ b/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefCorrectness class LazyEvalNodeAttributeDefaults < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'When setting a node attribute as the default value for a custom resource property, wrap the node attribute in `lazy {}` so that its value is available when the resource executes.'.freeze + MSG = 'When setting a node attribute as the default value for a custom resource property, wrap the node attribute in `lazy {}` so that its value is available when the resource executes.' def_node_matcher :non_lazy_node_attribute_default?, <<-PATTERN (send nil? :property (sym _) ... (hash <(pair (sym :default) $(send (send _ :node) :[] _) ) ...>)) diff --git a/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb b/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb index 23b7b38c5..9d907b2f9 100644 --- a/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +++ b/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb b/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb index ea1eed7de..96405a77b 100644 --- a/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +++ b/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefCorrectness class MetadataMissingName < Cop include RangeHelp - MSG = 'metadata.rb needs to include the name method or it will fail on Chef Infra Client 12 and later.'.freeze + MSG = 'metadata.rb needs to include the name method or it will fail on Chef Infra Client 12 and later.' def investigate(processed_source) return if processed_source.blank? diff --git a/lib/rubocop/cop/chef/correctness/node_normal.rb b/lib/rubocop/cop/chef/correctness/node_normal.rb index 23089d802..ad17022de 100644 --- a/lib/rubocop/cop/chef/correctness/node_normal.rb +++ b/lib/rubocop/cop/chef/correctness/node_normal.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # @@ -37,7 +38,7 @@ module ChefCorrectness # node.force_override['foo'] = true # class NodeNormal < Cop - MSG = 'Do not use node.normal. Replace with default/override/force_default/force_override attribute levels.'.freeze + MSG = 'Do not use node.normal. Replace with default/override/force_default/force_override attribute levels.' def_node_matcher :node_normal?, <<-PATTERN (send (send _ :node) :normal) diff --git a/lib/rubocop/cop/chef/correctness/node_normal_unless.rb b/lib/rubocop/cop/chef/correctness/node_normal_unless.rb index f7d3b64cf..39c770c28 100644 --- a/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +++ b/lib/rubocop/cop/chef/correctness/node_normal_unless.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # @@ -37,7 +38,7 @@ module ChefCorrectness # node.force_override_unless['foo'] = true # class NodeNormalUnless < Cop - MSG = 'Do not use node.normal_unless. Replace with default/override/force_default/force_override attribute levels.'.freeze + MSG = 'Do not use node.normal_unless. Replace with default/override/force_default/force_override attribute levels.' def_node_matcher :node_normal_unless?, <<-PATTERN (send (send _ :node) :normal_unless) diff --git a/lib/rubocop/cop/chef/correctness/node_save.rb b/lib/rubocop/cop/chef/correctness/node_save.rb index 2084a0e10..72f530713 100644 --- a/lib/rubocop/cop/chef/correctness/node_save.rb +++ b/lib/rubocop/cop/chef/correctness/node_save.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefCorrectness # node.save # class CookbookUsesNodeSave < Cop - MSG = "Don't use node.save to save partial node data to the Chef Infra Server mid-run unless it's absolutely necessary. Node.save can result in failed Chef Infra runs appearing in search and increases load on the Chef Infra Server.".freeze + MSG = "Don't use node.save to save partial node data to the Chef Infra Server mid-run unless it's absolutely necessary. Node.save can result in failed Chef Infra runs appearing in search and increases load on the Chef Infra Server." def_node_matcher :node_save?, <<-PATTERN (send (send nil? :node) :save) diff --git a/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb b/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb index 567cd5e14..18ebbf6f7 100644 --- a/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +++ b/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -44,7 +45,7 @@ module ChefCorrectness class NotifiesActionNotSymbol < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Resource notification and subscription actions should be symbols not strings.'.freeze + MSG = 'Resource notification and subscription actions should be symbols not strings.' def on_block(node) match_property_in_resource?(nil, %w(notifies subscribes), node) do |notifies_property| diff --git a/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb b/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb index 545eac828..b7e040ab5 100644 --- a/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +++ b/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. @@ -25,7 +26,7 @@ module ChefCorrectness # basic_auth_password = secure_password # class OpenSSLPasswordHelpers < Cop - MSG = 'The `secure_password` helper from the openssl cookbooks `Opscode::OpenSSL::Password` class should not be used to generate passwords.'.freeze + MSG = 'The `secure_password` helper from the openssl cookbooks `Opscode::OpenSSL::Password` class should not be used to generate passwords.' def_node_matcher :openssl_helper?, <<~PATTERN (const diff --git a/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb b/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb index 47ff8ca97..d3c957c90 100644 --- a/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +++ b/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ module ChefCorrectness class PowershellScriptDeleteFile < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Use the `file` or `directory` resources built into Chef Infra Client with the :delete action to remove files/directories instead of using Remove-Item in a powershell_script resource'.freeze + MSG = 'Use the `file` or `directory` resources built into Chef Infra Client with the :delete action to remove files/directories instead of using Remove-Item in a powershell_script resource' def on_block(node) match_property_in_resource?(:powershell_script, 'code', node) do |code_property| diff --git a/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb b/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb index a65256fe9..177ca110e 100644 --- a/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +++ b/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ module ChefCorrectness class ResourceSetsInternalProperties < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Do not set properties used internally by Chef Infra Client to track the system state.'.freeze + MSG = 'Do not set properties used internally by Chef Infra Client to track the system state.' def on_block(node) match_property_in_resource?(:service, 'running', node) do |prop| diff --git a/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb b/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb index 254062bb6..23983347a 100644 --- a/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +++ b/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ module ChefCorrectness class ResourceSetsNameProperty < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Resource sets the name property in the resource instead of using a name_property.'.freeze + MSG = 'Resource sets the name property in the resource instead of using a name_property.' def on_block(node) match_property_in_resource?(nil, 'name', node) do |name_node| diff --git a/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb b/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb index 0ebd5180e..f34861db7 100644 --- a/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +++ b/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ module ChefCorrectness class ResourceWithNoneAction < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Resource uses the nonexistent :none action instead of the :nothing action'.freeze + MSG = 'Resource uses the nonexistent :none action instead of the :nothing action' def on_block(node) match_property_in_resource?(nil, 'action', node) do |action_node| diff --git a/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb b/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb index 1896ba414..9264ca7a7 100644 --- a/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +++ b/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefCorrectness # not_if { ::File.exist?('/etc/foo/bar') } # class ScopedFileExist < Cop - MSG = 'Scope file exist to access the correct File class by using ::File.exist? not File.exist?.'.freeze + MSG = 'Scope file exist to access the correct File class by using ::File.exist? not File.exist?.' def_node_matcher :unscoped_file_exist?, <<-PATTERN (block (send nil? {:not_if :only_if}) (args) (send $(const nil? :File) {:exist? :exists?} (...))) diff --git a/lib/rubocop/cop/chef/correctness/service_resource.rb b/lib/rubocop/cop/chef/correctness/service_resource.rb index c3d4c7161..82f915af3 100644 --- a/lib/rubocop/cop/chef/correctness/service_resource.rb +++ b/lib/rubocop/cop/chef/correctness/service_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # @@ -27,7 +28,7 @@ module ChefCorrectness # command "/sbin/service/memcached start" # class ServiceResource < Cop - MSG = 'Use a service resource to start and stop services'.freeze + MSG = 'Use a service resource to start and stop services' def_node_matcher :execute_command?, <<-PATTERN (send nil? :command $str) diff --git a/lib/rubocop/cop/chef/correctness/tmp_path.rb b/lib/rubocop/cop/chef/correctness/tmp_path.rb index 68ac97672..608629663 100644 --- a/lib/rubocop/cop/chef/correctness/tmp_path.rb +++ b/lib/rubocop/cop/chef/correctness/tmp_path.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # @@ -30,7 +31,7 @@ module ChefCorrectness # # class TmpPath < Cop - MSG = 'Use file_cache_path rather than hard-coding tmp paths'.freeze + MSG = 'Use file_cache_path rather than hard-coding tmp paths' def_node_matcher :remote_file?, <<-PATTERN (send nil? :remote_file $str) diff --git a/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb b/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb index 0ed2c0533..a9789c00a 100644 --- a/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb +++ b/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ class UseAutomaticResourceName < Base extend RuboCop::Cop::AutoCorrector include RangeHelp - MSG = 'The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.'.freeze + MSG = 'The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.' def on_send(node) return unless node.method_name == :use_automatic_resource_name diff --git a/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb b/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb index 0fd560033..07e61bd4a 100644 --- a/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +++ b/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefDeprecations class ChefHandlerRecipe < Cop include RangeHelp - MSG = 'There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource'.freeze + MSG = 'There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource' def_node_matcher :chef_handler_recipe?, <<-PATTERN (send nil? :include_recipe (str {"chef_handler" "chef_handler::default"})) diff --git a/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb b/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb index 6a3930258..3b8943899 100644 --- a/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +++ b/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ module ChefDeprecations class ChefHandlerUsesSupports < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Use the type property instead of the deprecated supports property in the chef_handler resource. The supports property was removed in chef_handler cookbook version 3.0 (June 2017) and Chef Infra Client 14.0.'.freeze + MSG = 'Use the type property instead of the deprecated supports property in the chef_handler resource. The supports property was removed in chef_handler cookbook version 3.0 (June 2017) and Chef Infra Client 14.0.' def on_block(node) match_property_in_resource?(:chef_handler, 'supports', node) do |prop_node| diff --git a/lib/rubocop/cop/chef/deprecation/chef_rest.rb b/lib/rubocop/cop/chef/deprecation/chef_rest.rb index 80c867be8..a16686d0b 100644 --- a/lib/rubocop/cop/chef/deprecation/chef_rest.rb +++ b/lib/rubocop/cop/chef/deprecation/chef_rest.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefDeprecations # Chef::REST::RESTRequest.new(:GET, FOO, nil).call # class UsesChefRESTHelpers < Cop - MSG = "Don't use the helpers in Chef::REST which were removed in Chef Infra Client 13".freeze + MSG = "Don't use the helpers in Chef::REST which were removed in Chef Infra Client 13" def_node_matcher :require_rest?, <<-PATTERN (send nil? :require ( str "chef/rest")) diff --git a/lib/rubocop/cop/chef/deprecation/chef_rewind.rb b/lib/rubocop/cop/chef/deprecation/chef_rewind.rb index 2bab09fe2..9755bc25b 100644 --- a/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +++ b/lib/rubocop/cop/chef/deprecation/chef_rewind.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -46,7 +47,7 @@ class ChefRewind < Cop unwind: 'delete_resource', }.freeze - MSG = 'Use delete_resource / edit_resource introduced in Chef Infra Client 12.10 instead of functionality in the deprecated chef-rewind gem'.freeze + MSG = 'Use delete_resource / edit_resource introduced in Chef Infra Client 12.10 instead of functionality in the deprecated chef-rewind gem' def_node_matcher :rewind_gem_install?, <<-PATTERN (send nil? :chef_gem (str "chef-rewind")) diff --git a/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb b/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb index 51f902c1f..3e3dad74c 100644 --- a/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +++ b/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefDeprecations # platform_family?('windows') # class ChefWindowsPlatformHelper < Cop - MSG = "Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper.".freeze + MSG = "Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper." def_node_matcher :chef_platform_windows?, <<-PATTERN (send diff --git a/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb b/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb index c480ba3c6..e4a2b5993 100644 --- a/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +++ b/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ module ChefDeprecations # end # class ChefDKGenerators < Cop - MSG = 'When writing cookbook generators use the ChefCLI module instead of the ChefDK module which was removed in Chef Workstation 0.8 and later.'.freeze + MSG = 'When writing cookbook generators use the ChefCLI module instead of the ChefDK module which was removed in Chef Workstation 0.8 and later.' def on_const(node) # We want to catch calls like ChefCLI::CLI.whatever or places where classes are defined in the ChefDK module diff --git a/lib/rubocop/cop/chef/deprecation/cheffile.rb b/lib/rubocop/cop/chef/deprecation/cheffile.rb index 591a48d2f..071355ed4 100644 --- a/lib/rubocop/cop/chef/deprecation/cheffile.rb +++ b/lib/rubocop/cop/chef/deprecation/cheffile.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -24,7 +25,7 @@ module ChefDeprecations class Cheffile < Cop include RangeHelp - MSG = 'The Libarian-Chef depsolving project is no longer maintained and a Cheffile should not be used for cookbook depsolving. Consider using Policyfiles instead.'.freeze + MSG = 'The Libarian-Chef depsolving project is no longer maintained and a Cheffile should not be used for cookbook depsolving. Consider using Policyfiles instead.' def investigate(processed_source) return if processed_source.blank? diff --git a/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb b/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb index 9b81043a4..bc3c283cd 100644 --- a/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +++ b/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefDeprecations # at_exit { ChefSpec::Coverage.report! } # class ChefSpecCoverageReport < Cop - MSG = "Don't use the deprecated ChefSpec coverage report functionality in your specs.".freeze + MSG = "Don't use the deprecated ChefSpec coverage report functionality in your specs." def_node_matcher :coverage_reporter?, <<-PATTERN (block (send nil? :at_exit ) (args) (send (const (const nil? :ChefSpec) :Coverage) :report!)) diff --git a/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb b/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb index 8d91bc179..fab96f5a3 100644 --- a/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +++ b/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ module ChefDeprecations # end # class ChefSpecLegacyRunner < Cop - MSG = 'Use ChefSpec::SoloRunner or ChefSpec::ServerRunner instead of the deprecated ChefSpec::Runner.'.freeze + MSG = 'Use ChefSpec::SoloRunner or ChefSpec::ServerRunner instead of the deprecated ChefSpec::Runner.' def_node_matcher :chefspec_runner?, <<-PATTERN (const (const nil? :ChefSpec) :Runner) diff --git a/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb b/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb index a4eee23a5..53d1774d3 100644 --- a/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +++ b/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ module ChefDeprecations class ChocolateyPackageUninstallAction < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+'.freeze + MSG = 'Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+' def on_block(node) match_property_in_resource?(:chocolatey_package, 'action', node) do |choco_action| diff --git a/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb b/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb index 5ef90efc6..7c3e2ca3f 100644 --- a/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +++ b/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ class CookbookDependsOnCompatResource < Cop minimum_target_chef_version '12.19' - MSG = "Don't depend on the deprecated compat_resource cookbook made obsolete by Chef 12.19+".freeze + MSG = "Don't depend on the deprecated compat_resource cookbook made obsolete by Chef 12.19+" def_node_matcher :depends_compat_resource?, <<-PATTERN (send nil? :depends (str {"compat_resource"})) diff --git a/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb b/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb index a8f24f5dd..d12e26d97 100644 --- a/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +++ b/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ class CookbookDependsOnPartialSearch < Cop minimum_target_chef_version '13.0' - MSG = "Don't depend on the deprecated partial_search cookbook made obsolete by Chef 13".freeze + MSG = "Don't depend on the deprecated partial_search cookbook made obsolete by Chef 13" def_node_matcher :depends_partial_search?, <<-PATTERN (send nil? :depends (str "partial_search")) diff --git a/lib/rubocop/cop/chef/deprecation/depends_poise.rb b/lib/rubocop/cop/chef/deprecation/depends_poise.rb index a8e8c4c96..8d0cc505e 100644 --- a/lib/rubocop/cop/chef/deprecation/depends_poise.rb +++ b/lib/rubocop/cop/chef/deprecation/depends_poise.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -27,7 +28,7 @@ module ChefDeprecations # depends 'poise-service' # class CookbookDependsOnPoise < Cop - MSG = 'Cookbooks should not depend on the deprecated Poise framework'.freeze + MSG = 'Cookbooks should not depend on the deprecated Poise framework' def_node_matcher :depends_method?, <<-PATTERN (send nil? :depends $str) diff --git a/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb b/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb index 774d6039a..92c720eca 100644 --- a/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +++ b/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefDeprecations class DeprecatedChefSpecPlatform < Cop include RuboCop::Chef::CookbookHelpers - MSG = "Use currently supported platforms in ChefSpec listed at https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md. Fauxhai / ChefSpec will perform fuzzy matching on platform version so it's always best to be less specific ie. 10 instead of 10.3".freeze + MSG = "Use currently supported platforms in ChefSpec listed at https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md. Fauxhai / ChefSpec will perform fuzzy matching on platform version so it's always best to be less specific ie. 10 instead of 10.3" Gem::Dependency.new('', ['~> 1.4.5', '>= 1.4.6']).match?('', '1.4.6') diff --git a/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb b/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb index e2607117c..6ce4084b8 100644 --- a/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +++ b/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ module ChefDeprecations class UsesDeprecatedMixins < Cop include RangeHelp - MSG = "Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.".freeze + MSG = "Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later." def_node_matcher :deprecated_mixin?, <<-PATTERN (send nil? :include (const (const (const nil? :Chef) :Mixin) { :Language :LanguageIncludeAttribute :RecipeDefinitionDSLCore :LanguageIncludeRecipe })) diff --git a/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb b/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb index 73e3881ab..964988caf 100644 --- a/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +++ b/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ module ChefDeprecations # provider = resource.provider_for_action(:create) # class DeprecatedPlatformMethods < Cop - MSG = 'Use provider_for_action instead of the deprecated Chef::Platform methods in resources, which were removed in Chef Infra Client 13.'.freeze + MSG = 'Use provider_for_action instead of the deprecated Chef::Platform methods in resources, which were removed in Chef Infra Client 13.' def_node_matcher :platform_method?, <<-PATTERN (send (const (const nil? :Chef) :Platform) {:provider_for_resource :find_provider :find_provider_for_node} ... ) diff --git a/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb b/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb index 7c7133d78..bf7de1e31 100644 --- a/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +++ b/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -53,7 +54,7 @@ class DeprecatedShelloutMethods < Cop shell_out_with_systems_locale! ).freeze - MSG = 'Many legacy specialized shell_out methods were replaced in Chef Infra Client 14.3 and removed in Chef Infra Client 15. Use shell_out and any additional options if necessary.'.freeze + MSG = 'Many legacy specialized shell_out methods were replaced in Chef Infra Client 14.3 and removed in Chef Infra Client 15. Use shell_out and any additional options if necessary.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if DEPRECATED_SHELLOUT_METHODS.include?(node.method_name) diff --git a/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb b/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb index b7ea34ecd..5bf5e6a0d 100644 --- a/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +++ b/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefDeprecations # end # class DeprecatedWindowsVersionCheck < Cop - MSG = "Don't use the deprecated older_than_win_2012_or_8? helper. Windows versions before 2012 and 8 are now end of life and this helper will always return false.".freeze + MSG = "Don't use the deprecated older_than_win_2012_or_8? helper. Windows versions before 2012 and 8 are now end of life and this helper will always return false." def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :older_than_win_2012_or_8? diff --git a/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb b/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb index 3b9bbd69a..146291ada 100644 --- a/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +++ b/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -46,7 +47,7 @@ class DeprecatedYumRepositoryProperties < Cop minimum_target_chef_version '12.14' - MSG = 'With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several properties in the yum_repository resource were renamed. url -> baseurl, keyurl -> gpgkey, and mirrorexpire -> mirror_expire.'.freeze + MSG = 'With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several properties in the yum_repository resource were renamed. url -> baseurl, keyurl -> gpgkey, and mirrorexpire -> mirror_expire.' def on_block(node) %w(url keyurl mirrorexpire).each do |prop| diff --git a/lib/rubocop/cop/chef/deprecation/easy_install.rb b/lib/rubocop/cop/chef/deprecation/easy_install.rb index 6c5913600..87b2b7f32 100644 --- a/lib/rubocop/cop/chef/deprecation/easy_install.rb +++ b/lib/rubocop/cop/chef/deprecation/easy_install.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefDeprecations # end # class EasyInstallResource < Cop - MSG = "Don't use the deprecated easy_install resource removed in Chef Infra Client 13".freeze + MSG = "Don't use the deprecated easy_install resource removed in Chef Infra Client 13" def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :easy_install diff --git a/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb b/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb index f49a0ca61..133f320e2 100644 --- a/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +++ b/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefDeprecations # end class EOLAuditModeUsage < Cop - MSG = 'The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook. See https://www.inspec.io/ for more informmation.'.freeze + MSG = 'The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook. See https://www.inspec.io/ for more informmation.' def_node_matcher :control_group?, '(send nil? :control_group ...)' diff --git a/lib/rubocop/cop/chef/deprecation/epic_fail.rb b/lib/rubocop/cop/chef/deprecation/epic_fail.rb index 7398bdc4d..84472b922 100644 --- a/lib/rubocop/cop/chef/deprecation/epic_fail.rb +++ b/lib/rubocop/cop/chef/deprecation/epic_fail.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefDeprecations # end # class EpicFail < Cop - MSG = 'Use ignore_failure method instead of the deprecated epic_fail method'.freeze + MSG = 'Use ignore_failure method instead of the deprecated epic_fail method' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :epic_fail diff --git a/lib/rubocop/cop/chef/deprecation/erl_call.rb b/lib/rubocop/cop/chef/deprecation/erl_call.rb index 6907efcda..1c89d4c63 100644 --- a/lib/rubocop/cop/chef/deprecation/erl_call.rb +++ b/lib/rubocop/cop/chef/deprecation/erl_call.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefDeprecations # end # class ErlCallResource < Cop - MSG = "Don't use the deprecated erl_call resource removed in Chef Infra Client 13".freeze + MSG = "Don't use the deprecated erl_call resource removed in Chef Infra Client 13" def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :erl_call diff --git a/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb b/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb index ddb5f999c..1efeb1bc2 100644 --- a/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +++ b/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright (c) Chef Software Inc. # Author:: Tim Smith () @@ -82,7 +83,7 @@ module ChefDeprecations # Convert your legacy HWRPs to custom resources # class HWRPWithoutProvides < Cop - MSG = 'In Chef Infra Client 16 and later a legacy HWRP resource must use `provides` to define how the resource is called in recipes or other resources. To maintain compatibility with Chef Infra Client < 16 use both `resource_name` and `provides`.'.freeze + MSG = 'In Chef Infra Client 16 and later a legacy HWRP resource must use `provides` to define how the resource is called in recipes or other resources. To maintain compatibility with Chef Infra Client < 16 use both `resource_name` and `provides`.' def_node_matcher :HWRP?, <<-PATTERN (class diff --git a/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb b/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb index 3ace86ad7..19595eb66 100644 --- a/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +++ b/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ module ChefDeprecations # Write a custom resource using the custom resource DSL and avoid class based HWRPs entirely # class ResourceInheritsFromCompatResource < Cop - MSG = "HWRP style resource should inherit from the 'Chef::Resource' class and not the 'ChefCompat::Resource' class from the deprecated compat_resource cookbook.".freeze + MSG = "HWRP style resource should inherit from the 'Chef::Resource' class and not the 'ChefCompat::Resource' class from the deprecated compat_resource cookbook." def_node_matcher :inherits_from_compat_resource?, <<-PATTERN (class (const nil? _ ) (const (const nil? :ChefCompat) :Resource) ... ) diff --git a/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb b/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb index 145e3f9dc..402e45c17 100644 --- a/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +++ b/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ class LaunchdDeprecatedHashProperty < Cop minimum_target_chef_version '12.19' - MSG = "The launchd resource's hash property was renamed to plist_hash in Chef Infra Client 13+ to avoid conflicts with Ruby's hash class.".freeze + MSG = "The launchd resource's hash property was renamed to plist_hash in Chef Infra Client 13+ to avoid conflicts with Ruby's hash class." def on_block(node) match_property_in_resource?(:launchd, 'hash', node) do |hash_prop| diff --git a/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb b/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb index c8ea2ee43..a01473b93 100644 --- a/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +++ b/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -57,7 +58,7 @@ module ChefDeprecations # end # class LegacyNotifySyntax < Cop - MSG = 'Use the new-style notification syntax which allows you to notify resources defined later in a recipe or resource.'.freeze + MSG = 'Use the new-style notification syntax which allows you to notify resources defined later in a recipe or resource.' def_node_matcher :legacy_notify?, <<-PATTERN (send nil? ${:notifies :subscribes} $(sym _) (send nil? :resources (hash (pair $(sym _) $(...) ) ) ) $... ) @@ -80,7 +81,7 @@ def autocorrect(node) else "\"#{type.source}[\#{#{name.source}}]\"" end - new_val = "#{notify_type} #{action.source}, #{service_value}" + new_val = "#{notify_type} #{action.source}, #{service_value}".dup new_val << ", #{timing.first.source}" unless timing.empty? corrector.replace(node.loc.expression, new_val) end diff --git a/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb b/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb index 5ab2b7dd6..9c7ae3bea 100644 --- a/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +++ b/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefDeprecations # include_recipe 'yum::yum' # class LegacyYumCookbookRecipes < Cop - MSG = 'The elrepo, epel, ius, remi, and repoforge recipes were split into their own cookbooks and the yum recipe was renamed to be default with the release of yum cookbook 3.0 (Dec 2013).'.freeze + MSG = 'The elrepo, epel, ius, remi, and repoforge recipes were split into their own cookbooks and the yum recipe was renamed to be default with the release of yum cookbook 3.0 (Dec 2013).' def_node_matcher :old_yum_recipe?, <<-PATTERN (send nil? :include_recipe (str {"yum::elrepo" "yum::epel" "yum::ius" "yum::remi" "yum::repoforge" "yum::yum"})) diff --git a/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb b/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb index 79693bd00..cf1aed5a6 100644 --- a/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +++ b/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ module ChefDeprecations class LocaleDeprecatedLcAllProperty < Cop include RuboCop::Chef::CookbookHelpers - MSG = "The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 17".freeze + MSG = "The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 17" def on_block(node) match_property_in_resource?(:locale, 'lc_all', node) do |property| diff --git a/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb b/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb index 9ad6f683f..9275135fa 100644 --- a/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +++ b/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -49,7 +50,7 @@ class LogResourceNotifications < Cop minimum_target_chef_version '15.8' - MSG = 'In Chef Infra Client 16 the log resource no longer notifies when logging so notifications should not be triggered from log resources. Use the notify_group resource introduced in Chef Infra Client 15.8 instead to aggregate notifications.'.freeze + MSG = 'In Chef Infra Client 16 the log resource no longer notifies when logging so notifications should not be triggered from log resources. Use the notify_group resource introduced in Chef Infra Client 15.8 instead to aggregate notifications.' def on_block(node) match_property_in_resource?(:log, 'notifies', node) do |prop_node| diff --git a/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb b/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb index 50ed09790..c90f9869f 100644 --- a/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +++ b/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefDeprecations class NamePropertyWithDefaultValue < Cop include RangeHelp - MSG = "A resource property can't be marked as a name_property and also have a default value. This will fail in Chef Infra Client 13 or later.".freeze + MSG = "A resource property can't be marked as a name_property and also have a default value. This will fail in Chef Infra Client 13 or later." # match on a property or attribute that has any name and any type and a hash that # contains name_property/name_attribute true and any default value. These are wrapped in diff --git a/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb b/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb index f06324ec4..b2319d201 100644 --- a/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +++ b/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # @@ -17,8 +18,7 @@ module RuboCop module Cop module Chef module ChefDeprecations - # The node.deep_fetch method has been removed from Chef-Sugar, and must be replaced by - # the node.read API. + # The node.deep_fetch method has been removed from Chef-Sugar, and must be replaced by the node.read API. # # @example # @@ -34,31 +34,18 @@ module ChefDeprecations # # good # node.read!("foo") # - class NodeDeepFetch < Cop - MSG = 'Do not use node.deep_fetch. Replace with node.read to keep identical behavior.'.freeze - MSG2 = 'Do not use node.deep_fetch!. Replace with node.read! to keep identical behavior.'.freeze + class NodeDeepFetch < Base + extend RuboCop::Cop::AutoCorrector def_node_matcher :node_deep_fetch?, <<-PATTERN - (send (send _ :node) $:deep_fetch _) - PATTERN - - def_node_matcher :node_deep_fetch_bang?, <<-PATTERN - (send (send _ :node) $:deep_fetch! _) + (send (send _ :node) ${:deep_fetch :deep_fetch!} _) PATTERN def on_send(node) node_deep_fetch?(node) do - add_offense(node, location: :selector, message: MSG, severity: :warning) - end - - node_deep_fetch_bang?(node) do - add_offense(node, location: :selector, message: MSG2, severity: :warning) - end - end - - def autocorrect(node) - lambda do |corrector| - corrector.replace(node.loc.selector, fix_name(node.method_name)) + add_offense(node.loc.selector, message: "Do not use node.#{node.method_name}. Replace with node.#{fix_name(node.method_name)} to keep identical behavior.", severity: :warning) do |corrector| + corrector.replace(node.loc.selector, fix_name(node.method_name)) + end end end diff --git a/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb b/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb index d25e27010..aa6c8613b 100644 --- a/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +++ b/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ module ChefDeprecations # node['hostname'] # class NodeMethodsInsteadofAttributes < Cop - MSG = 'Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.'.freeze + MSG = 'Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.' def_node_matcher :node_ohai_methods?, <<-PATTERN (send (send nil? :node) #non_nested_ohai_attribute?) diff --git a/lib/rubocop/cop/chef/deprecation/node_set.rb b/lib/rubocop/cop/chef/deprecation/node_set.rb index f0ad2f9ef..5001122e7 100644 --- a/lib/rubocop/cop/chef/deprecation/node_set.rb +++ b/lib/rubocop/cop/chef/deprecation/node_set.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # @@ -30,7 +31,7 @@ module ChefDeprecations # node.normal['foo'] = true # class NodeSet < Cop - MSG = 'Do not use node.set. Replace with node.normal to keep identical behavior.'.freeze + MSG = 'Do not use node.set. Replace with node.normal to keep identical behavior.' def_node_matcher :node_set?, <<-PATTERN (send (send _ :node) $:set) diff --git a/lib/rubocop/cop/chef/deprecation/node_set_unless.rb b/lib/rubocop/cop/chef/deprecation/node_set_unless.rb index 9515ce1e2..61155c17f 100644 --- a/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +++ b/lib/rubocop/cop/chef/deprecation/node_set_unless.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # @@ -30,7 +31,7 @@ module ChefDeprecations # node.normal_unless['foo'] = true # class NodeSetUnless < Cop - MSG = 'Do not use node.set_unless. Replace with node.normal_unless to keep identical behavior.'.freeze + MSG = 'Do not use node.set_unless. Replace with node.normal_unless to keep identical behavior.' def_node_matcher :node_set_unless?, <<-PATTERN (send (send _ :node) $:set_unless) diff --git a/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb b/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb index ecbb13e2d..5b6b2bb20 100644 --- a/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +++ b/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # @@ -34,7 +35,7 @@ module ChefDeprecations # node.default['foo']['bar'] -= 1 # class NodeSetWithoutLevel < Cop - MSG = 'When setting a node attribute in Chef Infra Client 11 and later you must specify the precedence level.'.freeze + MSG = 'When setting a node attribute in Chef Infra Client 11 and later you must specify the precedence level.' def on_op_asgn(node) # make sure it was a += or -= diff --git a/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb b/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb index 598373e57..1a362bbb1 100644 --- a/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +++ b/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -47,7 +48,7 @@ module ChefDeprecations # end # class PartialSearchClassUsage < Cop - MSG = 'Legacy Chef::PartialSearch class usage should be updated to use the search helper instead with the filter_result key.'.freeze + MSG = 'Legacy Chef::PartialSearch class usage should be updated to use the search helper instead with the filter_result key.' def_node_matcher :partial_search_class?, <<-PATTERN (send (const (const ... :Chef) :PartialSearch) :new) diff --git a/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb b/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb index 97f9646d1..05f08d6ce 100644 --- a/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +++ b/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -47,7 +48,7 @@ module ChefDeprecations # end # class PartialSearchHelperUsage < Cop - MSG = 'Legacy partial_search usage should be updated to use :filter_result in the search helper instead'.freeze + MSG = 'Legacy partial_search usage should be updated to use :filter_result in the search helper instead' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :partial_search diff --git a/lib/rubocop/cop/chef/deprecation/poise_archive.rb b/lib/rubocop/cop/chef/deprecation/poise_archive.rb index a026dbc13..8b7c82de9 100644 --- a/lib/rubocop/cop/chef/deprecation/poise_archive.rb +++ b/lib/rubocop/cop/chef/deprecation/poise_archive.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ module ChefDeprecations class PoiseArchiveUsage < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'The poise_archive resource in the deprecated poise-archive should be replaced with the archive_file resource found in Chef Infra Client 15+'.freeze + MSG = 'The poise_archive resource in the deprecated poise-archive should be replaced with the archive_file resource found in Chef Infra Client 15+' def_node_matcher :depends_poise_archive?, <<-PATTERN (send nil? :depends (str "poise-archive")) diff --git a/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb b/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb index 2dbbe9430..31a116784 100644 --- a/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +++ b/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefDeprecations # powershell_version == 4.0 # class PowershellCookbookHelpers < Cop - MSG = "Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 15.8+ instead of the deprecated PowerShell cookbook helpers.".freeze + MSG = "Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 15.8+ instead of the deprecated PowerShell cookbook helpers." def_node_matcher :ps_cb_helper?, <<-PATTERN (send diff --git a/lib/rubocop/cop/chef/deprecation/require_recipe.rb b/lib/rubocop/cop/chef/deprecation/require_recipe.rb index 924ec19ae..1f93fd506 100644 --- a/lib/rubocop/cop/chef/deprecation/require_recipe.rb +++ b/lib/rubocop/cop/chef/deprecation/require_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefDeprecations # include_recipe 'foo' # class RequireRecipe < Cop - MSG = 'Use include_recipe instead of the require_recipe method'.freeze + MSG = 'Use include_recipe instead of the require_recipe method' def_node_matcher :require_recipe?, <<-PATTERN (send nil? :require_recipe $str) diff --git a/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb b/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb index cb9e9b412..0daf9e7cc 100644 --- a/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +++ b/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ module ChefDeprecations # provides :SOME_PROVIDER_NAME # class ResourceOverridesProvidesMethod < Cop - MSG = "Don't override the provides? method in a resource provider. Use provides :SOME_PROVIDER_NAME instead. This will cause failures in Chef Infra Client 13 and later.".freeze + MSG = "Don't override the provides? method in a resource provider. Use provides :SOME_PROVIDER_NAME instead. This will cause failures in Chef Infra Client 13 and later." def_node_search :provides, '(send nil? :provides ...)' diff --git a/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb b/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb index c4728aa0f..48fb6a63c 100644 --- a/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +++ b/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefDeprecations # my_resource = MyResource.resource_name # class ResourceUsesDslNameMethod < Cop - MSG = 'Use resource_name instead of the dsl_name method in resources. This will cause failures in Chef Infra Client 13 and later.'.freeze + MSG = 'Use resource_name instead of the dsl_name method in resources. This will cause failures in Chef Infra Client 13 and later.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :dsl_name diff --git a/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb b/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb index 8678a823d..94a325080 100644 --- a/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +++ b/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright (c) Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ class ResourceUsesOnlyResourceName < Cop include RuboCop::Chef::CookbookHelpers include RangeHelp - MSG = 'Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME.'.freeze + MSG = 'Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Make sure to use both `resource_name` and `provides` to change the name of the resource. You can also omit `resource_name` entirely if the value set matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME.' def_node_matcher :resource_name?, '(send nil? :resource_name (sym $_ ))' diff --git a/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb b/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb index 7260ceace..ccad55966 100644 --- a/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +++ b/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -26,7 +27,7 @@ module ChefDeprecations # provider_base ::Chef::Provider::SomethingSomething # class ResourceUsesProviderBaseMethod < Cop - MSG = "Don't use the deprecated provider_base method in a resource to specify the provider module to use. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use. This will cause failures in Chef Infra Client 13 and later.".freeze + MSG = "Don't use the deprecated provider_base method in a resource to specify the provider module to use. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use. This will cause failures in Chef Infra Client 13 and later." def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.method_name == :provider_base diff --git a/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb b/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb index 1ac156465..0c489356b 100644 --- a/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +++ b/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefDeprecations # end # class ResourceUsesUpdatedMethod < Cop - MSG = "Don't use updated = true/false to update resource state. This will cause failures in Chef Infra Client 13 and later.".freeze + MSG = "Don't use updated = true/false to update resource state. This will cause failures in Chef Infra Client 13 and later." def on_lvasgn(node) add_offense(node, location: :expression, message: MSG, severity: :warning) if node.node_parts.first == :updated diff --git a/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb b/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb index de968b44b..1cd5173fa 100644 --- a/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +++ b/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefDeprecations class Ruby27KeywordArgumentWarnings < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.'.freeze + MSG = 'Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.' def_node_matcher :positional_shellout?, <<-PATTERN (send nil? {:shell_out :shell_out!} ... $(hash ... )) diff --git a/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb b/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb index 7f276ed0a..d295b909e 100644 --- a/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +++ b/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ module ChefDeprecations class RubyBlockCreateAction < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Use the :run action in the ruby_block resource instead of the deprecated :create action'.freeze + MSG = 'Use the :run action in the ruby_block resource instead of the deprecated :create action' def on_block(node) match_property_in_resource?(:ruby_block, 'action', node) do |ruby_action| diff --git a/lib/rubocop/cop/chef/deprecation/run_command_helper.rb b/lib/rubocop/cop/chef/deprecation/run_command_helper.rb index 28580a755..f43112d2e 100644 --- a/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +++ b/lib/rubocop/cop/chef/deprecation/run_command_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefDeprecations # shell_out!('/bin/foo') # class UsesRunCommandHelper < Cop - MSG = "Use 'shell_out!' instead of the legacy 'run_command' or 'run_command_with_systems_locale' helpers for shelling out. The run_command helper was removed in Chef Infra Client 13.".freeze + MSG = "Use 'shell_out!' instead of the legacy 'run_command' or 'run_command_with_systems_locale' helpers for shelling out. The run_command helper was removed in Chef Infra Client 13." def_node_matcher :calls_run_command?, '(send nil? {:run_command :run_command_with_systems_locale} ...)' def_node_matcher :require_mixin_command?, '(send nil? :require (str "chef/mixin/command"))' diff --git a/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb b/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb index 63ee04cae..34fe039b2 100644 --- a/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +++ b/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ module ChefDeprecations # search(:node, '*:*', start: 0) # class SearchUsesPositionalParameters < Cop - MSG = "Don't use deprecated positional parameters in cookbook search queries.".freeze + MSG = "Don't use deprecated positional parameters in cookbook search queries." NAMED_PARAM_LOOKUP_TABLE = [nil, nil, 'start', 'rows', 'filter_result'].freeze diff --git a/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb b/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb index 5ccdac130..fb94972da 100644 --- a/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +++ b/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ module ChefDeprecations class UseInlineResourcesDefined < Cop include RangeHelp - MSG = 'use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified.'.freeze + MSG = 'use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified.' def on_send(node) if node.method_name == :use_inline_resources diff --git a/lib/rubocop/cop/chef/deprecation/user_supports_property.rb b/lib/rubocop/cop/chef/deprecation/user_supports_property.rb index b7ff92662..17aac2975 100644 --- a/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +++ b/lib/rubocop/cop/chef/deprecation/user_supports_property.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -43,7 +44,7 @@ module ChefDeprecations class UserDeprecatedSupportsProperty < Cop include RuboCop::Chef::CookbookHelpers - MSG = "The supports property was removed in Chef Infra Client 13 in favor of individual 'manage_home' and 'non_unique' properties.".freeze + MSG = "The supports property was removed in Chef Infra Client 13 in favor of individual 'manage_home' and 'non_unique' properties." def on_block(node) match_property_in_resource?(:user, 'supports', node) do |property| diff --git a/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb b/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb index 1a3e6407a..9c7f170fd 100644 --- a/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +++ b/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ class VerifyPropertyUsesFileExpansion < Cop minimum_target_chef_version '12.5' - MSG = "Use the 'path' variable in the verify property and not the 'file' variable which was removed in Chef Infra Client 13.".freeze + MSG = "Use the 'path' variable in the verify property and not the 'file' variable which was removed in Chef Infra Client 13." def on_block(node) match_property_in_resource?(nil, 'verify', node) do |verify| diff --git a/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb b/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb index a74c3f280..a582a107c 100644 --- a/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +++ b/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -43,7 +44,7 @@ module ChefDeprecations class WindowsFeatureServermanagercmd < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'The `windows_feature` resource no longer supports setting the `install_method` to `:servermanagercmd`. `:windows_feature_dism` or `:windows_feature_powershell` should be used instead.'.freeze + MSG = 'The `windows_feature` resource no longer supports setting the `install_method` to `:servermanagercmd`. `:windows_feature_dism` or `:windows_feature_powershell` should be used instead.' def on_block(node) match_property_in_resource?(:windows_feature, :install_method, node) do |prop_node| diff --git a/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb b/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb index 71b62c09e..c3e0d29d3 100644 --- a/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +++ b/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -45,7 +46,7 @@ class WindowsTaskChangeAction < Cop minimum_target_chef_version '13.0' - MSG = 'The :change action in the windows_task resource was removed when windows_task was added to Chef Infra Client 13+. The default action of :create should can now be used to create an update tasks.'.freeze + MSG = 'The :change action in the windows_task resource was removed when windows_task was added to Chef Infra Client 13+. The default action of :create should can now be used to create an update tasks.' def on_block(node) match_property_in_resource?(:windows_task, 'action', node) do |action_node| diff --git a/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb b/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb index 291316772..61b43c1be 100644 --- a/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +++ b/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -39,7 +40,7 @@ class WindowsVersionHelpers < Cop minimum_target_chef_version '14.0' - MSG = "Use node['platform_version'] and node['kernel'] data introduced in Chef Infra Client 14 instead of the deprecated Windows::VersionHelper helpers from the Windows cookbook.".freeze + MSG = "Use node['platform_version'] and node['kernel'] data introduced in Chef Infra Client 14 instead of the deprecated Windows::VersionHelper helpers from the Windows cookbook." def_node_matcher :windows_helper?, <<-PATTERN (send ( const ( const {nil? cbase} :Windows ) :VersionHelper ) $_ ) diff --git a/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb b/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb index 3a0d99696..886bd4c8e 100644 --- a/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +++ b/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -26,7 +27,7 @@ module ChefDeprecations # include_recipe 'xml::ruby' # class IncludingXMLRubyRecipe < Cop - MSG = 'Do not include the deprecated xml::ruby recipe to install the nokogiri gem. Chef Infra Client 12 and later ships with nokogiri included.'.freeze + MSG = 'Do not include the deprecated xml::ruby recipe to install the nokogiri gem. Chef Infra Client 12 and later ships with nokogiri included.' def_node_matcher :xml_ruby_recipe?, <<-PATTERN (send nil? :include_recipe (str "xml::ruby")) diff --git a/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb b/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb index 679294000..a2bfdee5f 100644 --- a/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +++ b/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefDeprecations class IncludingYumDNFCompatRecipe < Cop include RangeHelp - MSG = 'Do not include the deprecated yum::dnf_yum_compat default recipe to install yum on dnf systems. Chef Infra Client now includes built in support for DNF packages.'.freeze + MSG = 'Do not include the deprecated yum::dnf_yum_compat default recipe to install yum on dnf systems. Chef Infra Client now includes built in support for DNF packages.' def_node_matcher :yum_dnf_compat_recipe_usage?, <<-PATTERN (send nil? :include_recipe (str "yum::dnf_yum_compat")) diff --git a/lib/rubocop/cop/chef/effortless/berksfile.rb b/lib/rubocop/cop/chef/effortless/berksfile.rb index 0a187b9a9..f1abb7643 100644 --- a/lib/rubocop/cop/chef/effortless/berksfile.rb +++ b/lib/rubocop/cop/chef/effortless/berksfile.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -24,7 +25,7 @@ module ChefEffortless class Berksfile < Cop include RangeHelp - MSG = 'Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.'.freeze + MSG = 'Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.' def investigate(processed_source) return if processed_source.blank? diff --git a/lib/rubocop/cop/chef/effortless/data_bags.rb b/lib/rubocop/cop/chef/effortless/data_bags.rb index 35c408879..c564eb012 100644 --- a/lib/rubocop/cop/chef/effortless/data_bags.rb +++ b/lib/rubocop/cop/chef/effortless/data_bags.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -26,7 +27,7 @@ module ChefEffortless # data_bag_item('admins', login) # data_bag(data_bag_name) class CookbookUsesDatabags < Cop - MSG = 'Cookbook uses data bags, which cannot be used in the Effortless Infra pattern'.freeze + MSG = 'Cookbook uses data bags, which cannot be used in the Effortless Infra pattern' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if %i(data_bag data_bag_item).include?(node.method_name) diff --git a/lib/rubocop/cop/chef/effortless/node_environment.rb b/lib/rubocop/cop/chef/effortless/node_environment.rb index 303eb386f..906da8d93 100644 --- a/lib/rubocop/cop/chef/effortless/node_environment.rb +++ b/lib/rubocop/cop/chef/effortless/node_environment.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -27,7 +28,7 @@ module ChefEffortless # node.chef_environment == "production" # class CookbookUsesEnvironmments < Cop - MSG = 'Cookbook uses environments, which cannot be used in Policyfiles or Effortless Infra'.freeze + MSG = 'Cookbook uses environments, which cannot be used in Policyfiles or Effortless Infra' def on_send(node) if %i(environment chef_environment).include?(node.method_name) && node.receiver && node.receiver.send_type? && node.receiver.method_name == :node diff --git a/lib/rubocop/cop/chef/effortless/node_policygroup.rb b/lib/rubocop/cop/chef/effortless/node_policygroup.rb index 0fce847c6..d5a65d7a0 100644 --- a/lib/rubocop/cop/chef/effortless/node_policygroup.rb +++ b/lib/rubocop/cop/chef/effortless/node_policygroup.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -26,7 +27,7 @@ module ChefEffortless # node.policy_group == "foo" # class CookbookUsesPolicygroups < Cop - MSG = 'Cookbook uses Policy Groups, which cannot be used with Effortless Infra'.freeze + MSG = 'Cookbook uses Policy Groups, which cannot be used with Effortless Infra' def on_send(node) if node.method_name == :policy_group && node.receiver && node.receiver.send_type? && node.receiver.method_name == :node diff --git a/lib/rubocop/cop/chef/effortless/node_roles.rb b/lib/rubocop/cop/chef/effortless/node_roles.rb index 57d87bc81..050b5ce0c 100644 --- a/lib/rubocop/cop/chef/effortless/node_roles.rb +++ b/lib/rubocop/cop/chef/effortless/node_roles.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -27,7 +28,7 @@ module ChefEffortless # node.roles.include?('webserver') # class CookbookUsesRoles < Cop - MSG = 'Cookbook uses roles, which cannot be used in Policyfiles or Effortless Infra'.freeze + MSG = 'Cookbook uses roles, which cannot be used in Policyfiles or Effortless Infra' def on_send(node) if %i(role? roles).include?(node.method_name) && node.receiver && node.receiver.send_type? && node.receiver.method_name == :node diff --git a/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb b/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb index 109f321e5..4c48e582f 100644 --- a/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +++ b/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -27,7 +28,7 @@ module ChefEffortless # search(:node, 'role:bar') # class SearchForEnvironmentsOrRoles < Cop - MSG = 'Cookbook uses search with a node query that looks for a role or environment'.freeze + MSG = 'Cookbook uses search with a node query that looks for a role or environment' def on_send(node) if node.method_name == :search && node.arguments[1]&.value&.match?(/chef_environment|role/) diff --git a/lib/rubocop/cop/chef/effortless/search_used.rb b/lib/rubocop/cop/chef/effortless/search_used.rb index 13836b11f..e3029fb5d 100644 --- a/lib/rubocop/cop/chef/effortless/search_used.rb +++ b/lib/rubocop/cop/chef/effortless/search_used.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -26,7 +27,7 @@ module ChefEffortless # search(:node, 'run_list:recipe\[bacula\:\:server\]') # class CookbookUsesSearch < Cop - MSG = 'Cookbook uses search, which cannot be used in the Effortless Infra pattern'.freeze + MSG = 'Cookbook uses search, which cannot be used in the Effortless Infra pattern' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :search diff --git a/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb b/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb index ef2474fba..f28103d3a 100644 --- a/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +++ b/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ module ChefModernize class AllowedActionsFromInitialize < Cop include RangeHelp - MSG = 'The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.'.freeze + MSG = 'The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.' def on_def(node) return unless node.method_name == :initialize diff --git a/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb b/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb index a025067e1..a906fda2a 100644 --- a/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +++ b/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ class IncludingAptDefaultRecipe < Cop minimum_target_chef_version '12.7' - MSG = 'Do not include the Apt default recipe to update package cache. Instead use the apt_update resource, which is built into Chef Infra Client 12.7 and later.'.freeze + MSG = 'Do not include the Apt default recipe to update package cache. Instead use the apt_update resource, which is built into Chef Infra Client 12.7 and later.' def_node_matcher :apt_recipe_usage?, <<-PATTERN (send nil? :include_recipe (str {"apt" "apt::default"})) diff --git a/lib/rubocop/cop/chef/modernize/berksfile_source.rb b/lib/rubocop/cop/chef/modernize/berksfile_source.rb index ac9cbeccd..2be116c1a 100644 --- a/lib/rubocop/cop/chef/modernize/berksfile_source.rb +++ b/lib/rubocop/cop/chef/modernize/berksfile_source.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefModernize # source 'https://supermarket.chef.io' # class LegacyBerksfileSource < Cop - MSG = 'Do not use legacy Berksfile community sources. Use Chef Supermarket instead.'.freeze + MSG = 'Do not use legacy Berksfile community sources. Use Chef Supermarket instead.' def_node_matcher :berksfile_site?, <<-PATTERN (send nil? :site (:sym _)) diff --git a/lib/rubocop/cop/chef/modernize/build_essential.rb b/lib/rubocop/cop/chef/modernize/build_essential.rb index 823393af8..d9550d288 100644 --- a/lib/rubocop/cop/chef/modernize/build_essential.rb +++ b/lib/rubocop/cop/chef/modernize/build_essential.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ module ChefModernize # build_essential 'install compilation tools' # class UseBuildEssentialResource < Cop - MSG = 'Use the build_essential resource instead of the legacy build-essential recipe. This resource ships in the build-essential cookbook v5.0+ and is built into Chef Infra Client 14+'.freeze + MSG = 'Use the build_essential resource instead of the legacy build-essential recipe. This resource ships in the build-essential cookbook v5.0+ and is built into Chef Infra Client 14+' def_node_matcher :build_essential_recipe_usage?, <<-PATTERN (send nil? :include_recipe (str {"build-essential" "build-essential::default"})) diff --git a/lib/rubocop/cop/chef/modernize/chef_14_resources.rb b/lib/rubocop/cop/chef/modernize/chef_14_resources.rb index 3d49e0b1d..720b4b16a 100644 --- a/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +++ b/lib/rubocop/cop/chef/modernize/chef_14_resources.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ class UnnecessaryDependsChef14 < Cop minimum_target_chef_version '14.0' - MSG = "Don't depend on cookbooks made obsolete by Chef Infra Client 14+. These community cookbooks contain resources that are now included in Chef Infra Client itself.".freeze + MSG = "Don't depend on cookbooks made obsolete by Chef Infra Client 14+. These community cookbooks contain resources that are now included in Chef Infra Client itself." def_node_matcher :legacy_depends?, <<-PATTERN (send nil? :depends (str {"build-essential" "chef_handler" "chef_hostname" "dmg" "mac_os_x" "swap" "sysctl"}) ... ) diff --git a/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb b/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb index 9a4df7156..332680a7d 100644 --- a/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +++ b/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ class ChefGemNokogiri < Cop include RangeHelp include RuboCop::Chef::CookbookHelpers - MSG = 'The nokogiri gem ships in Chef Infra Client 12+ and does not need to be installed before being used.'.freeze + MSG = 'The nokogiri gem ships in Chef Infra Client 12+ and does not need to be installed before being used.' def_node_matcher :nokogiri_install?, <<-PATTERN (send nil? :chef_gem (str "nokogiri")) diff --git a/lib/rubocop/cop/chef/modernize/compile_time_resources.rb b/lib/rubocop/cop/chef/modernize/compile_time_resources.rb index 11c94f55d..aff59c642 100644 --- a/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +++ b/lib/rubocop/cop/chef/modernize/compile_time_resources.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefModernize # end # class ResourceForcingCompileTime < Cop - MSG = "Set 'compile_time true' in resources when available instead of forcing resources to run at compile time by setting an action on the block.".freeze + MSG = "Set 'compile_time true' in resources when available instead of forcing resources to run at compile time by setting an action on the block." def_node_matcher :compile_time_resource?, <<-PATTERN (send (block (send nil? {:build_essential :chef_gem :hostname :ohai_hint} (...)) (args) (...)) $:run_action (sym ...)) diff --git a/lib/rubocop/cop/chef/modernize/conditional_using_test.rb b/lib/rubocop/cop/chef/modernize/conditional_using_test.rb index b6493323b..35ad6f097 100644 --- a/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +++ b/lib/rubocop/cop/chef/modernize/conditional_using_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # only_if { ::File.exist?('bin/foo') } # class ConditionalUsingTest < Cop - MSG = "Use ::File.exist?('/foo/bar') instead of the slower 'test -f /foo/bar' which requires shelling out".freeze + MSG = "Use ::File.exist?('/foo/bar') instead of the slower 'test -f /foo/bar' which requires shelling out" def_node_matcher :resource_conditional?, <<~PATTERN (send nil? {:not_if :only_if} $str ) diff --git a/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb b/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb index 355daec31..2aea83990 100644 --- a/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +++ b/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ class CronManageResource < Cop minimum_target_chef_version '14.4' - MSG = 'The cron_manage resource was renamed to cron_access in the 6.1 release of the cron cookbook and later shipped in Chef Infra Client 14.4. The new resource name should be used.'.freeze + MSG = 'The cron_manage resource was renamed to cron_access in the 6.1 release of the cron cookbook and later shipped in Chef Infra Client 14.4. The new resource name should be used.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :cron_manage diff --git a/lib/rubocop/cop/chef/modernize/databag_helpers.rb b/lib/rubocop/cop/chef/modernize/databag_helpers.rb index c2e8e2566..1e5cb0d30 100644 --- a/lib/rubocop/cop/chef/modernize/databag_helpers.rb +++ b/lib/rubocop/cop/chef/modernize/databag_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ module ChefModernize # encrypted_data = data_bag_item('foo2', 'bar2') # class DatabagHelpers < Cop - MSG = 'Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.'.freeze + MSG = 'Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.' def_node_matcher :data_bag_class_load?, <<-PATTERN (send diff --git a/lib/rubocop/cop/chef/modernize/default_action_initializer.rb b/lib/rubocop/cop/chef/modernize/default_action_initializer.rb index 63b3b96c0..d87eb1235 100644 --- a/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +++ b/lib/rubocop/cop/chef/modernize/default_action_initializer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ module ChefModernize class DefaultActionFromInitialize < Cop include RangeHelp - MSG = 'The default action of a resource can be set with the "default_action" helper instead of using the initialize method.'.freeze + MSG = 'The default action of a resource can be set with the "default_action" helper instead of using the initialize method.' def_node_matcher :action_variable_assignment?, <<-PATTERN (ivasgn {:@action :@default_action} $(...)) diff --git a/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb b/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb index bd252e1b6..c14390610 100644 --- a/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +++ b/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefModernize class DefinesChefSpecMatchers < Cop include RangeHelp - MSG = 'ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook'.freeze + MSG = 'ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook' def_node_matcher :chefspec_matcher?, <<-PATTERN (if ( :defined? (const nil? :ChefSpec)) ... ) diff --git a/lib/rubocop/cop/chef/modernize/definitions.rb b/lib/rubocop/cop/chef/modernize/definitions.rb index f7be3afdd..63749c142 100644 --- a/lib/rubocop/cop/chef/modernize/definitions.rb +++ b/lib/rubocop/cop/chef/modernize/definitions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -23,7 +24,7 @@ module ChefModernize class Definitions < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Legacy Chef Infra definitions should be rewritten as custom resources to take full advantage of the Chef Infra feature set.'.freeze + MSG = 'Legacy Chef Infra definitions should be rewritten as custom resources to take full advantage of the Chef Infra feature set.' def on_block(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.respond_to?(:method_name) && node.method_name == :define diff --git a/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb b/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb index 458064a92..8d034768d 100644 --- a/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +++ b/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ class DependsOnZypperCookbook < Cop minimum_target_chef_version '13.3' - MSG = "Don't depend on the zypper cookbook as the zypper_repository resource is built into Chef Infra Client 13.3+".freeze + MSG = "Don't depend on the zypper cookbook as the zypper_repository resource is built into Chef Infra Client 13.3+" def_node_matcher :zypper_depends?, <<-PATTERN (send nil? :depends (str "zypper")) diff --git a/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb b/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb index 304e2fe20..d8a10f8c0 100644 --- a/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +++ b/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -27,7 +28,7 @@ module ChefModernize class DslIncludeInResource < Cop include RangeHelp - MSG = 'Chef Infra Client 12.4+ includes the Chef::DSL::Recipe in the resource and provider classed by default so there is no need to include this DSL in your resources or providers.'.freeze + MSG = 'Chef Infra Client 12.4+ includes the Chef::DSL::Recipe in the resource and provider classed by default so there is no need to include this DSL in your resources or providers.' def_node_matcher :dsl_include?, <<-PATTERN (send nil? :include diff --git a/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb b/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb index 0815e0c23..5d109963e 100644 --- a/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +++ b/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefModernize class EmptyResourceInitializeMethod < Cop include RangeHelp - MSG = 'There is no need for an empty initialize method in a resource'.freeze + MSG = 'There is no need for an empty initialize method in a resource' def_node_matcher :empty_initialize?, <<-PATTERN (def :initialize (args (restarg :args)) (zsuper)) diff --git a/lib/rubocop/cop/chef/modernize/execute_apt_update.rb b/lib/rubocop/cop/chef/modernize/execute_apt_update.rb index e55bb3921..872f9e174 100644 --- a/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +++ b/lib/rubocop/cop/chef/modernize/execute_apt_update.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ module ChefModernize # end # class ExecuteAptUpdate < Cop - MSG = 'Use the apt_update resource instead of the execute resource to run an apt-get update package cache update'.freeze + MSG = 'Use the apt_update resource instead of the execute resource to run an apt-get update package cache update' def_node_matcher :execute_apt_update?, <<-PATTERN (send nil? :execute (str { "apt-get update" "apt-get update -y" "apt-get -y update" })) diff --git a/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb b/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb index 1450491f2..2b44c0149 100644 --- a/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +++ b/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ class ExecuteScExe < Cop minimum_target_chef_version '14.0' - MSG = 'Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions with the full idempotency of the windows_service resource. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details on creating services with the windows_service resource'.freeze + MSG = 'Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions with the full idempotency of the windows_service resource. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details on creating services with the windows_service resource' # non block execute resources def on_send(node) diff --git a/lib/rubocop/cop/chef/modernize/execute_sleep.rb b/lib/rubocop/cop/chef/modernize/execute_sleep.rb index 80ac7cd38..ebadab7c4 100644 --- a/lib/rubocop/cop/chef/modernize/execute_sleep.rb +++ b/lib/rubocop/cop/chef/modernize/execute_sleep.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -41,7 +42,7 @@ class ExecuteSleep < Cop minimum_target_chef_version '15.5' - MSG = 'Chef Infra Client 15.5 and later include a chef_sleep resource that should be used to sleep between executing resources if necessary instead of using the bash or execute resources to run the sleep command.'.freeze + MSG = 'Chef Infra Client 15.5 and later include a chef_sleep resource that should be used to sleep between executing resources if necessary instead of using the bash or execute resources to run the sleep command.' # non block execute resources def on_send(node) diff --git a/lib/rubocop/cop/chef/modernize/execute_sysctl.rb b/lib/rubocop/cop/chef/modernize/execute_sysctl.rb index b002722ca..19f59a939 100644 --- a/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +++ b/lib/rubocop/cop/chef/modernize/execute_sysctl.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -41,7 +42,7 @@ class ExecuteSysctl < Cop minimum_target_chef_version '14.0' - MSG = 'Chef Infra Client 14.0 and later includes a sysctl resource that should be used to idempotently load sysctl values instead of templating files and using execute to load them.'.freeze + MSG = 'Chef Infra Client 14.0 and later includes a sysctl resource that should be used to idempotently load sysctl values instead of templating files and using execute to load them.' # non block execute resources def on_send(node) diff --git a/lib/rubocop/cop/chef/modernize/execute_tzutil.rb b/lib/rubocop/cop/chef/modernize/execute_tzutil.rb index cf4ac3f1d..2d825b501 100644 --- a/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +++ b/lib/rubocop/cop/chef/modernize/execute_tzutil.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ class ExecuteTzUtil < Cop minimum_target_chef_version '14.6' - MSG = 'Use the timezone resource included in Chef Infra Client 14.6+ instead of shelling out to tzutil'.freeze + MSG = 'Use the timezone resource included in Chef Infra Client 14.6+ instead of shelling out to tzutil' def_node_matcher :execute_resource?, <<-PATTERN (send nil? :execute $str) diff --git a/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb b/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb index 6acefaf3a..61cb3dbe3 100644 --- a/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +++ b/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016-2019, Chef Software, Inc. # Author:: Tim Smith () @@ -27,7 +28,7 @@ module ChefModernize # # ~FC013 # class FoodcriticComments < Cop - MSG = 'Remove legacy code comments that disable Foodcritic rules'.freeze + MSG = 'Remove legacy code comments that disable Foodcritic rules' def investigate(processed_source) return unless processed_source.ast diff --git a/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb b/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb index 9e394a8f7..94cffe205 100644 --- a/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +++ b/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # default_action :foo # class IfProvidesDefaultAction < Cop - MSG = 'if defined?(default_action) is no longer necessary in Chef Resources as default_action shipped in Chef 10.8.'.freeze + MSG = 'if defined?(default_action) is no longer necessary in Chef Resources as default_action shipped in Chef 10.8.' def on_defined?(node) return unless node.arguments.first == s(:send, nil, :default_action) diff --git a/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb b/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb index 5a0c51434..66bce1885 100644 --- a/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +++ b/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefModernize class IncludingMixinShelloutInResources < Cop include RangeHelp - MSG = 'There is no need to include Chef::Mixin::ShellOut or Chef::Mixin::PowershellOut in resources or providers as this is already done by Chef Infra Client 12.4+.'.freeze + MSG = 'There is no need to include Chef::Mixin::ShellOut or Chef::Mixin::PowershellOut in resources or providers as this is already done by Chef Infra Client 12.4+.' def_node_matcher :include_shellout?, <<-PATTERN (send nil? :include (const (const (const nil? :Chef) :Mixin) {:ShellOut :PowershellOut})) diff --git a/lib/rubocop/cop/chef/modernize/libarchive_file.rb b/lib/rubocop/cop/chef/modernize/libarchive_file.rb index 921d2df7d..a3ef6c620 100644 --- a/lib/rubocop/cop/chef/modernize/libarchive_file.rb +++ b/lib/rubocop/cop/chef/modernize/libarchive_file.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ class LibarchiveFileResource < Cop minimum_target_chef_version '15.0' - MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource'.freeze + MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource' def_node_matcher :notification_property?, <<-PATTERN (send nil? {:notifies :subscribes} (sym _) $(...) (sym _)) diff --git a/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb b/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb index b21c21d02..c6d5f80e8 100644 --- a/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +++ b/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ class MacOsXUserdefaults < Cop minimum_target_chef_version '14.0' - MSG = 'The mac_os_x_userdefaults resource was renamed to macos_userdefaults when it was added to Chef Infra Client 14.0. The new resource name should be used.'.freeze + MSG = 'The mac_os_x_userdefaults resource was renamed to macos_userdefaults when it was added to Chef Infra Client 14.0. The new resource name should be used.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :mac_os_x_userdefaults diff --git a/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb b/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb index 2254ce732..2d217257a 100644 --- a/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +++ b/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefModernize class MinitestHandlerUsage < Cop include RangeHelp - MSG = 'Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.'.freeze + MSG = 'Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.' def_node_matcher :minitest_depends?, <<-PATTERN (send nil? :depends (str "minitest-handler")) diff --git a/lib/rubocop/cop/chef/modernize/node_init_package.rb b/lib/rubocop/cop/chef/modernize/node_init_package.rb index f2b47ee1d..0ec6ffa5f 100644 --- a/lib/rubocop/cop/chef/modernize/node_init_package.rb +++ b/lib/rubocop/cop/chef/modernize/node_init_package.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -41,7 +42,7 @@ module ChefModernize class NodeInitPackage < Base extend RuboCop::Cop::AutoCorrector - MSG = "Use node['init_package'] to check for systemd instead of reading the contents of '/proc/1/comm'".freeze + MSG = "Use node['init_package'] to check for systemd instead of reading the contents of '/proc/1/comm'" def_node_matcher :file_reads_proc_1_comm?, <<-PATTERN (send (const {(cbase) nil?} {:File :IO}) {:open :read} (str "/proc/1/comm")) diff --git a/lib/rubocop/cop/chef/modernize/node_roles_include.rb b/lib/rubocop/cop/chef/modernize/node_roles_include.rb index df77a0b17..4c1a28b09 100644 --- a/lib/rubocop/cop/chef/modernize/node_roles_include.rb +++ b/lib/rubocop/cop/chef/modernize/node_roles_include.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # node.role?('foo') # class NodeRolesInclude < Cop - MSG = "Use `node.role?('foo')` to check if a node includes a role instead of `node['roles'].include?('foo')`.".freeze + MSG = "Use `node.role?('foo')` to check if a node includes a role instead of `node['roles'].include?('foo')`." def_node_matcher :node_role_include?, <<-PATTERN (send diff --git a/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb b/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb index 66e9c2c6b..d99027ba8 100644 --- a/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +++ b/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # include_recipe 'ohai' # class IncludingOhaiDefaultRecipe < Cop - MSG = "Use the ohai_plugin resource to ship custom Ohai plugins instead of using the ohai::default recipe. If you're not shipping custom Ohai plugins, then you can remove this recipe entirely".freeze + MSG = "Use the ohai_plugin resource to ship custom Ohai plugins instead of using the ohai::default recipe. If you're not shipping custom Ohai plugins, then you can remove this recipe entirely" def_node_matcher :ohai_recipe_usage?, <<-PATTERN (send nil? :include_recipe (str {"ohai" "ohai::default"})) diff --git a/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb b/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb index 9ff3dbf7c..248b4b44a 100644 --- a/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +++ b/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ class OpensslRsaKeyResource < Cop minimum_target_chef_version '14.0' - MSG = 'The openssl_rsa_key resource was renamed to openssl_rsa_private_key in Chef Infra Client 14.0. The new resource name should be used.'.freeze + MSG = 'The openssl_rsa_key resource was renamed to openssl_rsa_private_key in Chef Infra Client 14.0. The new resource name should be used.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :openssl_rsa_key diff --git a/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb b/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb index f99f3c9c5..2992ed9a4 100644 --- a/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +++ b/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ class OpensslX509Resource < Cop minimum_target_chef_version '14.4' - MSG = 'The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.'.freeze + MSG = 'The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :openssl_x509 diff --git a/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb b/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb index c714d4ff5..bb75d89ce 100644 --- a/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +++ b/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefModernize # end # class OsxConfigProfileResource < Cop - MSG = 'The osx_config_profile resource was renamed to osx_profile. The new resource name should be used.'.freeze + MSG = 'The osx_config_profile resource was renamed to osx_profile. The new resource name should be used.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :osx_config_profile diff --git a/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb b/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb index c95da3acf..30bdb673e 100644 --- a/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +++ b/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ class PowershellScriptExpandArchive < Cop minimum_target_chef_version '15.0' - MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource'.freeze + MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource' def on_block(node) match_property_in_resource?(:powershell_script, 'code', node) do |code_property| diff --git a/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb b/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb index 93a97fe3f..7872ddb9a 100644 --- a/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +++ b/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -49,7 +50,7 @@ class PowerShellGuardInterpreter < Cop minimum_target_chef_version '13.0' - MSG = 'PowerShell is already set as the default guard interpreter for `powershell_script` and `batch` resources in Chef Infra Client 13 and later and does not need to be specified.'.freeze + MSG = 'PowerShell is already set as the default guard interpreter for `powershell_script` and `batch` resources in Chef Infra Client 13 and later and does not need to be specified.' def on_block(node) match_property_in_resource?(%i(powershell_script batch), 'guard_interpreter', node) do |interpreter| diff --git a/lib/rubocop/cop/chef/modernize/powershell_install_package.rb b/lib/rubocop/cop/chef/modernize/powershell_install_package.rb index e0322354d..95fc29fc6 100644 --- a/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +++ b/lib/rubocop/cop/chef/modernize/powershell_install_package.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ class PowershellInstallPackage < Cop minimum_target_chef_version '12.16' - MSG = 'Use the powershell_package resource built into Chef Infra Client 12.16+ instead of using Install-Package in a powershell_script resource'.freeze + MSG = 'Use the powershell_package resource built into Chef Infra Client 12.16+ instead of using Install-Package in a powershell_script resource' def on_block(node) match_property_in_resource?(:powershell_script, 'code', node) do |code_property| diff --git a/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb b/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb index 81636e9ad..c6825cda1 100644 --- a/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +++ b/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ class PowershellInstallWindowsFeature < Cop minimum_target_chef_version '14.0' - MSG = 'Use the windows_feature resource built into Chef Infra Client 14+ instead of using Install-WindowsFeature or Add-WindowsFeature in a powershell_script resource'.freeze + MSG = 'Use the windows_feature resource built into Chef Infra Client 14+ instead of using Install-WindowsFeature or Add-WindowsFeature in a powershell_script resource' def on_block(node) match_property_in_resource?(:powershell_script, 'code', node) do |code_property| diff --git a/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb b/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb index 62365a6f7..5d683541d 100644 --- a/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +++ b/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # property :bob, String, name_property: true # class PropertyWithNameAttribute < Cop - MSG = 'Resource property sets name_attribute instead of name_property'.freeze + MSG = 'Resource property sets name_attribute instead of name_property' # match on a property that has any name and any type and a hash that # contains name_attribute true. The hash pairs are wrapped in diff --git a/lib/rubocop/cop/chef/modernize/provides_initializer.rb b/lib/rubocop/cop/chef/modernize/provides_initializer.rb index 12cc895d0..88e28407b 100644 --- a/lib/rubocop/cop/chef/modernize/provides_initializer.rb +++ b/lib/rubocop/cop/chef/modernize/provides_initializer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefModernize class ProvidesFromInitialize < Cop include RangeHelp - MSG = 'Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.'.freeze + MSG = 'Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.' def_node_matcher :provides_assignment?, <<-PATTERN (ivasgn :@provides $(sym ...)) diff --git a/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb b/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb index 211d39740..f7fc4ba7e 100644 --- a/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +++ b/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefModernize class ResourceNameFromInitialize < Cop include RangeHelp - MSG = 'The name of a resource can be set with the "resource_name" helper instead of using the initialize method.'.freeze + MSG = 'The name of a resource can be set with the "resource_name" helper instead of using the initialize method.' def on_def(node) return unless node.method_name == :initialize diff --git a/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb b/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb index 3ceee22da..a1e491ad2 100644 --- a/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +++ b/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ module ChefModernize # property :severity, String # class SetOrReturnInResources < Cop - MSG = 'Do not use set_or_return within a method to define a property for a resource. Use the property method instead, which supports validation, reporting, and documentation functionality'.freeze + MSG = 'Do not use set_or_return within a method to define a property for a resource. Use the property method instead, which supports validation, reporting, and documentation functionality' def on_send(node) if node.method_name == :set_or_return diff --git a/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb b/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb index c18a75229..c8e715e62 100644 --- a/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +++ b/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ module ChefModernize # end # class CustomResourceWithAttributes < Cop - MSG = 'Custom Resources should contain properties not attributes'.freeze + MSG = 'Custom Resources should contain properties not attributes' def_node_matcher :attribute?, <<-PATTERN (send nil? $:attribute ... ) diff --git a/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb b/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb index 01e4f269d..30d69a8cf 100644 --- a/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +++ b/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -47,7 +48,7 @@ class RespondToCompileTime < Cop minimum_target_chef_version '12.1' - MSG = 'There is no need to check if the chef_gem resource supports compile_time as Chef Infra Client 12.1 and later support the compile_time property.'.freeze + MSG = 'There is no need to check if the chef_gem resource supports compile_time as Chef Infra Client 12.1 and later support the compile_time property.' def_node_matcher :compile_time_method_defined?, <<-PATTERN (if diff --git a/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb b/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb index b0ce89493..fd7da75df 100644 --- a/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +++ b/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ class RespondToInMetadata < Cop minimum_target_chef_version '12.15' - MSG = 'It is no longer necessary to use respond_to? or if_defined? in metadata.rb in Chef Infra Client 12.15 and later'.freeze + MSG = 'It is no longer necessary to use respond_to? or if_defined? in metadata.rb in Chef Infra Client 12.15 and later' def on_if(node) if_respond_to?(node) do diff --git a/lib/rubocop/cop/chef/modernize/respond_to_provides.rb b/lib/rubocop/cop/chef/modernize/respond_to_provides.rb index 95303095c..6697d92ce 100644 --- a/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +++ b/lib/rubocop/cop/chef/modernize/respond_to_provides.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ module ChefModernize # provides :foo # class RespondToProvides < Cop - MSG = 'Using `respond_to?(:provides)` or `if defined? provides` in resources is no longer necessary in Chef Infra Client 12+.'.freeze + MSG = 'Using `respond_to?(:provides)` or `if defined? provides` in resources is no longer necessary in Chef Infra Client 12+.' def on_if(node) if_respond_to_provides?(node) do diff --git a/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb b/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb index b0d5564ce..700a4c0a3 100644 --- a/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +++ b/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # resource_name :foo # class RespondToResourceName < Cop - MSG = 'respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+'.freeze + MSG = 'respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+' def on_if(node) if_respond_to_resource_name?(node) do diff --git a/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb b/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb index c5f5969ed..0a3e194b7 100644 --- a/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +++ b/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -37,7 +38,7 @@ class WindowsScResource < Cop minimum_target_chef_version '14.0' - MSG = 'Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions without the need for the sc cookbook dependency. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details.'.freeze + MSG = 'Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions without the need for the sc cookbook dependency. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :sc_windows diff --git a/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb b/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb index b1d89f70e..1c8304566 100644 --- a/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +++ b/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ class SevenZipArchiveResource < Cop minimum_target_chef_version '15.0' - MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive'.freeze + MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :seven_zip_archive diff --git a/lib/rubocop/cop/chef/modernize/shell_out_helper.rb b/lib/rubocop/cop/chef/modernize/shell_out_helper.rb index 3717935da..f0760e5d2 100644 --- a/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +++ b/lib/rubocop/cop/chef/modernize/shell_out_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ class ShellOutHelper < Cop minimum_target_chef_version '12.11' - MSG = "Use the built-in `shell_out` helper available in Chef Infra Client 12.11+ instead of calling `Mixlib::ShellOut.new('foo').run_command`.".freeze + MSG = "Use the built-in `shell_out` helper available in Chef Infra Client 12.11+ instead of calling `Mixlib::ShellOut.new('foo').run_command`." def_node_matcher :mixlib_shellout_run_cmd?, <<-PATTERN (send diff --git a/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb b/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb index f182cf564..4f96eae0c 100644 --- a/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +++ b/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ module ChefModernize class ShellOutToChocolatey < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command'.freeze + MSG = 'Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command' def on_block(node) match_property_in_resource?(:powershell_script, 'code', node) do |code_property| diff --git a/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb b/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb index 7544df806..840ad9be7 100644 --- a/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +++ b/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -43,7 +44,7 @@ class SimplifyAptPpaSetup < Cop include RangeHelp include RuboCop::Chef::CookbookHelpers - MSG = 'The apt_repository resource allows setting up PPAs without using the full URL to ppa.launchpad.net.'.freeze + MSG = 'The apt_repository resource allows setting up PPAs without using the full URL to ppa.launchpad.net.' def on_block(node) match_property_in_resource?(:apt_repository, 'uri', node) do |uri| diff --git a/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb b/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb index 9c460ff42..3f287a932 100644 --- a/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb +++ b/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ class SysctlParamResource < Cop minimum_target_chef_version '14.0' - MSG = 'The sysctl_param resource was renamed to sysctl when it was added to Chef Infra Client 14.0. The new resource name should be used.'.freeze + MSG = 'The sysctl_param resource was renamed to sysctl when it was added to Chef Infra Client 14.0. The new resource name should be used.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :sysctl_param diff --git a/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb b/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb index da032e4fc..8a2bf0ed0 100644 --- a/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +++ b/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize class UnnecessaryMixlibShelloutRequire < Cop include RangeHelp - MSG = 'Chef Infra Client 12.4+ includes mixlib/shellout automatically in resources and providers.'.freeze + MSG = 'Chef Infra Client 12.4+ includes mixlib/shellout automatically in resources and providers.' def_node_matcher :require_mixlibshellout?, <<-PATTERN (send nil? :require ( str "mixlib/shellout")) diff --git a/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb b/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb index fab37602b..223b4cfd6 100644 --- a/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +++ b/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefModernize # package %w(bmon htop vim curl) # class UseMultipackageInstalls < Cop - MSG = 'Pass an array of packages to package resources instead of interating over an array of packages when using multi-package capable package subystem such as apt, yum, chocolatey, dnf, or zypper. Multipackage installs are faster and simplify logs.'.freeze + MSG = 'Pass an array of packages to package resources instead of interating over an array of packages when using multi-package capable package subystem such as apt, yum, chocolatey, dnf, or zypper. Multipackage installs are faster and simplify logs.' MULTIPACKAGE_PLATS = %w(debian redhat suse amazon fedora scientific oracle rhel ubuntu centos redhat).freeze def_node_matcher :platform_or_platform_family?, <<-PATTERN diff --git a/lib/rubocop/cop/chef/modernize/use_require_relative.rb b/lib/rubocop/cop/chef/modernize/use_require_relative.rb index a766214d0..d0a8745f3 100644 --- a/lib/rubocop/cop/chef/modernize/use_require_relative.rb +++ b/lib/rubocop/cop/chef/modernize/use_require_relative.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize # require_relative '../libraries/helpers' # class UseRequireRelative < Cop - MSG = 'Instead of using require with a File.expand_path and __FILE__ use the simpler require_relative method.'.freeze + MSG = 'Instead of using require with a File.expand_path and __FILE__ use the simpler require_relative method.' def_node_matcher :require_with_expand_path?, <<-PATTERN (send nil? :require diff --git a/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb b/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb index d2d4e04de..f58528c97 100644 --- a/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +++ b/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ class WhyRunSupportedTrue < Cop minimum_target_chef_version '13.0' - MSG = 'whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+'.freeze + MSG = 'whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+' # match on both whyrun_supported? and the typo form why_run_supported? def_node_matcher :whyrun_true?, <<-PATTERN diff --git a/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb b/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb index bf95c747f..064a789e9 100644 --- a/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +++ b/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefModernize class IncludingWindowsDefaultRecipe < Cop include RangeHelp - MSG = 'Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client'.freeze + MSG = 'Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client' def_node_matcher :windows_recipe_usage?, <<-PATTERN (send nil? :include_recipe (str {"windows" "windows::default"})) diff --git a/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb b/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb index 56c21d50b..ee0ada97e 100644 --- a/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +++ b/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ class WindowsRegistryUAC < Cop minimum_target_chef_version '15.0' - MSG = 'Chef Infra Client 15.0 and later includes a windows_uac resource that should be used to set Windows UAC values instead of setting registry keys directly.'.freeze + MSG = 'Chef Infra Client 15.0 and later includes a windows_uac resource that should be used to set Windows UAC values instead of setting registry keys directly.' # non block execute resources def on_send(node) diff --git a/lib/rubocop/cop/chef/modernize/windows_zipfile.rb b/lib/rubocop/cop/chef/modernize/windows_zipfile.rb index 14a71de84..20345c75d 100644 --- a/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +++ b/lib/rubocop/cop/chef/modernize/windows_zipfile.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ class WindowsZipfileUsage < Cop minimum_target_chef_version '15.0' - MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook'.freeze + MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :windows_zipfile diff --git a/lib/rubocop/cop/chef/modernize/zipfile_resource.rb b/lib/rubocop/cop/chef/modernize/zipfile_resource.rb index cc6873843..daff47e8d 100644 --- a/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +++ b/lib/rubocop/cop/chef/modernize/zipfile_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ class ZipfileResource < Cop minimum_target_chef_version '15.0' - MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.'.freeze + MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.' def_node_matcher :depends_zipfile?, <<-PATTERN (send nil? :depends (str "zipfile")) diff --git a/lib/rubocop/cop/chef/modernize/zypper_repo.rb b/lib/rubocop/cop/chef/modernize/zypper_repo.rb index bf1df0415..481173ab9 100644 --- a/lib/rubocop/cop/chef/modernize/zypper_repo.rb +++ b/lib/rubocop/cop/chef/modernize/zypper_repo.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -43,7 +44,7 @@ class UsesZypperRepo < Cop minimum_target_chef_version '13.3' - MSG = 'The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.'.freeze + MSG = 'The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :zypper_repo diff --git a/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb b/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb index 3e212b0e1..effb44f7c 100644 --- a/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +++ b/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -39,7 +40,7 @@ class AptRepositoryDistributionDefault < Cop include RuboCop::Chef::CookbookHelpers include RangeHelp - MSG = "There is no need to pass `distribution node['lsb']['codename']` to an apt_repository resource as this is done automatically by the apt_repository resource.".freeze + MSG = "There is no need to pass `distribution node['lsb']['codename']` to an apt_repository resource as this is done automatically by the apt_repository resource." def_node_matcher :default_dist?, <<-PATTERN (send nil? :distribution (send (send (send nil? :node) :[] ({sym str} {:lsb "lsb"})) :[] ({sym str} {:codename "codename"}))) diff --git a/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb b/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb index 29c10e73b..23a3b562e 100644 --- a/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +++ b/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -39,7 +40,7 @@ class AptRepositoryNotifiesAptUpdate < Cop include RuboCop::Chef::CookbookHelpers include RangeHelp - MSG = 'There is no need to notify an apt-get update when an apt_repository is created as this is done automatically by the apt_repository resource.'.freeze + MSG = 'There is no need to notify an apt-get update when an apt_repository is created as this is done automatically by the apt_repository resource.' def on_block(node) match_property_in_resource?(:apt_repository, 'notifies', node) do |notifies| diff --git a/lib/rubocop/cop/chef/redundant/attribute_metadata.rb b/lib/rubocop/cop/chef/redundant/attribute_metadata.rb index c3608d7a1..75fb8ce3a 100644 --- a/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/attribute_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -36,7 +37,7 @@ class AttributeMetadata < Cop include RangeHelp include RuboCop::Chef::AutocorrectHelpers - MSG = 'The attribute metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The attribute metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :attribute diff --git a/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb b/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb index fc39e97df..677d7138d 100644 --- a/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefRedundantCode class ConflictsMetadata < Cop include RangeHelp - MSG = 'The conflicts metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The conflicts metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :conflicts diff --git a/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb b/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb index 98c0693f2..540b82a27 100644 --- a/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +++ b/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefRedundantCode class CustomResourceWithAllowedActions < Cop include RangeHelp - MSG = 'It is not necessary to set `actions` or `allowed_actions` in custom resources as Chef Infra Client determines these automatically from the set of all actions defined in the resource'.freeze + MSG = 'It is not necessary to set `actions` or `allowed_actions` in custom resources as Chef Infra Client determines these automatically from the set of all actions defined in the resource' def_node_matcher :allowed_actions?, <<-PATTERN (send nil? {:allowed_actions :actions} ... ) diff --git a/lib/rubocop/cop/chef/redundant/grouping_metadata.rb b/lib/rubocop/cop/chef/redundant/grouping_metadata.rb index 3351c5ac0..7e0597b9a 100644 --- a/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/grouping_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ class GroupingMetadata < Cop include RangeHelp include RuboCop::Chef::AutocorrectHelpers - MSG = 'The grouping metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The grouping metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :grouping diff --git a/lib/rubocop/cop/chef/redundant/long_description_metadata.rb b/lib/rubocop/cop/chef/redundant/long_description_metadata.rb index 2cf834d67..76de3028b 100644 --- a/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/long_description_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ class LongDescriptionMetadata < Cop include RangeHelp include RuboCop::Chef::AutocorrectHelpers - MSG = 'The long_description metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The long_description metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :long_description diff --git a/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb b/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb index ba6e4d23c..c01c6631f 100644 --- a/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +++ b/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefRedundantCode # platform_family?('debian', 'rhel') # class MultiplePlatformChecks < Cop - MSG = 'You can pass multiple values to the platform? and platform_family? helpers instead of calling the helpers multiple times.'.freeze + MSG = 'You can pass multiple values to the platform? and platform_family? helpers instead of calling the helpers multiple times.' def_node_matcher :or_platform_helpers?, <<-PATTERN (or (send nil? ${:platform? :platform_family?} $_ )* ) diff --git a/lib/rubocop/cop/chef/redundant/name_property_and_required.rb b/lib/rubocop/cop/chef/redundant/name_property_and_required.rb index 41aa553c9..f8518a974 100644 --- a/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +++ b/lib/rubocop/cop/chef/redundant/name_property_and_required.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -59,7 +60,7 @@ module ChefRedundantCode # property :config_file, String, required: true # class NamePropertyIsRequired < Cop - MSG = 'Resource properties marked as name properties should not also be required properties'.freeze + MSG = 'Resource properties marked as name properties should not also be required properties' # match on a property or attribute that has any name and any type and a hash that # contains name_property: true and required: true. These are wrapped in <> which means diff --git a/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb b/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb index 7e1b99963..f9c62aa57 100644 --- a/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +++ b/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ module ChefRedundantCode # node['name'] # class OhaiAttributeToString < Cop - MSG = "This Ohai node attribute is already a string and doesn't need to be converted".freeze + MSG = "This Ohai node attribute is already a string and doesn't need to be converted" def_node_matcher :platform_to_s?, <<-PATTERN (send (send (send nil? :node) :[] $(str {"platform" "platform_family" "platform_version" "fqdn" "hostname" "os" "name"}) ) :to_s ) diff --git a/lib/rubocop/cop/chef/redundant/property_splat_regex.rb b/lib/rubocop/cop/chef/redundant/property_splat_regex.rb index 57cbf5d94..6147ed375 100644 --- a/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +++ b/lib/rubocop/cop/chef/redundant/property_splat_regex.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefRedundantCode class PropertySplatRegex < Cop include RangeHelp - MSG = 'There is no need to validate the input of properties in resources using a regex value that will always pass.'.freeze + MSG = 'There is no need to validate the input of properties in resources using a regex value that will always pass.' def_node_matcher :property_with_regex_splat?, <<-PATTERN (send nil? {:property :attribute} (sym _) ... (hash <$(pair (sym :regex) (regexp (str ".*") (regopt))) ...>)) diff --git a/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb b/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb index 4cff50727..9e741bb23 100644 --- a/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +++ b/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefRedundantCode class PropertyWithRequiredAndDefault < Cop include RangeHelp - MSG = 'Resource properties should not be both required and have a default value. This will fail on Chef Infra Client 13+'.freeze + MSG = 'Resource properties should not be both required and have a default value. This will fail on Chef Infra Client 13+' # match on a property or attribute that has any name and any type and a hash that # contains default: true and required: true. These are wrapped in <> which means diff --git a/lib/rubocop/cop/chef/redundant/provides_metadata.rb b/lib/rubocop/cop/chef/redundant/provides_metadata.rb index 87c6bc4fb..fbdcf28d1 100644 --- a/lib/rubocop/cop/chef/redundant/provides_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/provides_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefRedundantCode class ProvidesMetadata < Cop include RangeHelp - MSG = 'The provides metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The provides metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :provides diff --git a/lib/rubocop/cop/chef/redundant/recipe_metadata.rb b/lib/rubocop/cop/chef/redundant/recipe_metadata.rb index 03f1308f4..9d37a9a44 100644 --- a/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/recipe_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -31,7 +32,7 @@ class RecipeMetadata < Cop include RangeHelp include RuboCop::Chef::AutocorrectHelpers - MSG = "The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the cookbook's README.md file instead.".freeze + MSG = "The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the cookbook's README.md file instead." def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :recipe diff --git a/lib/rubocop/cop/chef/redundant/replaces_metadata.rb b/lib/rubocop/cop/chef/redundant/replaces_metadata.rb index ba1994338..564fb5911 100644 --- a/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/replaces_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefRedundantCode class ReplacesMetadata < Cop include RangeHelp - MSG = 'The replaces metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The replaces metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :replaces diff --git a/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb b/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb index b3e598561..dc6ad9902 100644 --- a/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +++ b/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefRedundantCode class ResourceWithNothingAction < Cop include RangeHelp - MSG = 'There is no need to define a :nothing action in your resource as Chef Infra Client provides the :nothing action by default for every resource.'.freeze + MSG = 'There is no need to define a :nothing action in your resource as Chef Infra Client provides the :nothing action by default for every resource.' def_node_matcher :nothing_action?, <<-PATTERN (block (send nil? :action (sym :nothing)) (args) ... ) diff --git a/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb b/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb index fdfd08b87..016d6deed 100644 --- a/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +++ b/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -24,7 +25,7 @@ module ChefRedundantCode # property :sensitive, [true, false], default: false # class SensitivePropertyInResource < Cop - MSG = 'Every Chef Infra resource already includes a sensitive property with a default value of false.'.freeze + MSG = 'Every Chef Infra resource already includes a sensitive property with a default value of false.' def_node_matcher :sensitive_property?, <<-PATTERN (send nil? {:property :attribute} (sym :sensitive) ... (hash (pair (sym :default) (false)))) diff --git a/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb b/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb index cd73621fe..38a62ac94 100644 --- a/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +++ b/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefRedundantCode class StringPropertyWithNilDefault < Cop include RangeHelp - MSG = 'Properties have a nil value by default so there is no need to set the default value to nil.'.freeze + MSG = 'Properties have a nil value by default so there is no need to set the default value to nil.' def_node_matcher :string_property_with_nil_default?, <<-PATTERN (send nil? :property (sym _) diff --git a/lib/rubocop/cop/chef/redundant/suggests_metadata.rb b/lib/rubocop/cop/chef/redundant/suggests_metadata.rb index 0f7311a23..8a72bf428 100644 --- a/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +++ b/lib/rubocop/cop/chef/redundant/suggests_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefRedundantCode class SuggestsMetadata < Cop include RangeHelp - MSG = 'The suggests metadata.rb method is not used and is unnecessary in cookbooks.'.freeze + MSG = 'The suggests metadata.rb method is not used and is unnecessary in cookbooks.' def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :suggests diff --git a/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb b/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb index 64a66b2a0..580257434 100644 --- a/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +++ b/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -28,7 +29,7 @@ module ChefRedundantCode class UnnecessaryDesiredState < Cop include RangeHelp - MSG = 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'.freeze + MSG = 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.' def_node_matcher :property?, <<-PATTERN (send nil? {:property :attribute} (sym _) ... $(hash ...)) diff --git a/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb b/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb index 536f96f3b..531717c9d 100644 --- a/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +++ b/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefRedundantCode # attribute :name, kind_of: String, name_attribute: true # class UnnecessaryNameProperty < Cop - MSG = 'There is no need to define a property or attribute named :name in a resource as Chef Infra defines this on all resources by default.'.freeze + MSG = 'There is no need to define a property or attribute named :name in a resource as Chef Infra defines this on all resources by default.' def_node_matcher :name_attribute?, <<-PATTERN (send nil? :attribute diff --git a/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb b/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb index 97b5fd1fa..8a0354fcd 100644 --- a/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +++ b/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -42,7 +43,7 @@ module ChefRedundantCode # class UseCreateIfMissing < Cop include RuboCop::Chef::CookbookHelpers - MSG = 'Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.'.freeze + MSG = 'Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.' def_node_matcher :not_if_file_exist?, <<-PATTERN (block (send nil? :not_if) (args) (send (const {nil? (cbase)} :File) {:exist? :exists?} $(str ...))) diff --git a/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb b/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb index e700c98e6..574cc2788 100644 --- a/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +++ b/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefSharing # maintainer_email 'bob@bobberson.com' # class DefaultMetadataMaintainer < Cop - MSG = 'Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.'.freeze + MSG = 'Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.' def_node_matcher :default_metadata?, '(send nil? {:maintainer :maintainer_email} (str {"YOUR_COMPANY_NAME" "The Authors" "YOUR_EMAIL" "you@example.com"}))' diff --git a/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb b/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb index ac777c5ef..252e9e1ec 100644 --- a/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +++ b/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -30,7 +31,7 @@ module ChefSharing # license 'Apache-2.0' # class EmptyMetadataField < Cop - MSG = 'Cookbook metadata.rb contains an field with an empty string.'.freeze + MSG = 'Cookbook metadata.rb contains an field with an empty string.' def_node_matcher :field?, '(send nil? _ $str ...)' diff --git a/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb b/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb index 4eef08dff..c8360fc15 100644 --- a/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +++ b/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ class IncludePropertyDescriptions < Cop minimum_target_chef_version '13.9' - MSG = 'Resource properties should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.'.freeze + MSG = 'Resource properties should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.' # any method named property being called with a symbol argument and anything else def_node_matcher :property?, '(send nil? :property (sym _) ...)' diff --git a/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb b/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb index caaa65552..54e2285df 100644 --- a/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +++ b/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ class IncludeResourceDescriptions < Cop minimum_target_chef_version '13.9' - MSG = 'Resources should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.'.freeze + MSG = 'Resources should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.' def investigate(processed_source) return if processed_source.blank? diff --git a/lib/rubocop/cop/chef/sharing/include_resource_examples.rb b/lib/rubocop/cop/chef/sharing/include_resource_examples.rb index e1ed810a1..12d243885 100644 --- a/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +++ b/lib/rubocop/cop/chef/sharing/include_resource_examples.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ class IncludeResourceExamples < Cop minimum_target_chef_version '13.9' - MSG = 'Resources should include examples field to allow automated documention. Requires Chef Infra Client 13.9 or later.'.freeze + MSG = 'Resources should include examples field to allow automated documention. Requires Chef Infra Client 13.9 or later.' def investigate(processed_source) return if processed_source.blank? diff --git a/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb b/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb index b49ef08cc..c93fdbd15 100644 --- a/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +++ b/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefSharing # source_url 'http://gitlab.com/something/something' # class InsecureCookbookURL < Cop - MSG = 'Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields'.freeze + MSG = 'Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields' def_node_matcher :insecure_cb_url?, <<-PATTERN (send nil? {:source_url :issues_url} (str #insecure_url?)) diff --git a/lib/rubocop/cop/chef/sharing/invalid_license_string.rb b/lib/rubocop/cop/chef/sharing/invalid_license_string.rb index e630da214..82334f797 100644 --- a/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +++ b/lib/rubocop/cop/chef/sharing/invalid_license_string.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith () @@ -454,7 +455,7 @@ class InvalidLicenseString < Cop 'UNLICENSED': 'all rights reserved', }.freeze - MSG = 'Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved". See https://spdx.org/licenses/ for a complete list of license identifiers.'.freeze + MSG = 'Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved". See https://spdx.org/licenses/ for a complete list of license identifiers.' def_node_matcher :license?, '(send nil? :license $str ...)' diff --git a/lib/rubocop/cop/chef/style/attribute_keys.rb b/lib/rubocop/cop/chef/style/attribute_keys.rb index d72d62eed..fb7d3343f 100644 --- a/lib/rubocop/cop/chef/style/attribute_keys.rb +++ b/lib/rubocop/cop/chef/style/attribute_keys.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Noah Kantrowitz # @@ -43,7 +44,7 @@ module ChefStyle class AttributeKeys < Cop include RuboCop::Cop::ConfigurableEnforcedStyle - MSG = 'Use %s to access node attributes'.freeze + MSG = 'Use %s to access node attributes' def_node_matcher :node_attribute_access?, <<-PATTERN (send (send _ :node) :[] _) diff --git a/lib/rubocop/cop/chef/style/chef_whaaat.rb b/lib/rubocop/cop/chef/style/chef_whaaat.rb index 9025f1c98..b502a699b 100644 --- a/lib/rubocop/cop/chef/style/chef_whaaat.rb +++ b/lib/rubocop/cop/chef/style/chef_whaaat.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefStyle # Chef Infra configures your systems # class ChefWhaaat < Cop - MSG = 'Do you mean Chef (the company) or a Chef product (e.g. Chef Infra, Chef InSpec, etc)?'.freeze + MSG = 'Do you mean Chef (the company) or a Chef product (e.g. Chef Infra, Chef InSpec, etc)?' def investigate(processed_source) return unless processed_source.ast diff --git a/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb b/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb index d2d0f9ace..6f3e06b39 100644 --- a/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +++ b/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016-2019, Chef Software, Inc. # Author:: Tim Smith () @@ -22,7 +23,7 @@ module ChefStyle # Replaces double spaces between sentences with a single space. # Note: This is DISABLED by default. class CommentSentenceSpacing < Cop - MSG = 'Use a single space after sentences in comments'.freeze + MSG = 'Use a single space after sentences in comments' def investigate(processed_source) return unless processed_source.ast diff --git a/lib/rubocop/cop/chef/style/comments_copyright_format.rb b/lib/rubocop/cop/chef/style/comments_copyright_format.rb index 71a252136..29f808123 100644 --- a/lib/rubocop/cop/chef/style/comments_copyright_format.rb +++ b/lib/rubocop/cop/chef/style/comments_copyright_format.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016-2019, Chef Software, Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ module ChefStyle class CopyrightCommentFormat < Cop require 'date' - MSG = 'Properly format copyrights header comments'.freeze + MSG = 'Properly format copyrights header comments' def investigate(processed_source) return unless processed_source.ast diff --git a/lib/rubocop/cop/chef/style/comments_default_copyright.rb b/lib/rubocop/cop/chef/style/comments_default_copyright.rb index 2b4fb6bca..9845151ef 100644 --- a/lib/rubocop/cop/chef/style/comments_default_copyright.rb +++ b/lib/rubocop/cop/chef/style/comments_default_copyright.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016-2019, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefStyle # Copyright:: 2019 Chef Software, Inc. # class DefaultCopyrightComments < Cop - MSG = 'Cookbook copyright comment headers should be updated for a real person or organization.'.freeze + MSG = 'Cookbook copyright comment headers should be updated for a real person or organization.' def investigate(processed_source) return unless processed_source.ast diff --git a/lib/rubocop/cop/chef/style/comments_format.rb b/lib/rubocop/cop/chef/style/comments_format.rb index 1c67daae4..f5e729c4a 100644 --- a/lib/rubocop/cop/chef/style/comments_format.rb +++ b/lib/rubocop/cop/chef/style/comments_format.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016-2019, Chef Software, Inc. # Author:: Tim Smith () @@ -40,7 +41,7 @@ module ChefStyle # Cookbook:: Tomcat # class CommentFormat < Cop - MSG = 'Properly format header comments'.freeze + MSG = 'Properly format header comments' def investigate(processed_source) return unless processed_source.ast diff --git a/lib/rubocop/cop/chef/style/file_mode.rb b/lib/rubocop/cop/chef/style/file_mode.rb index bf50bffa8..24751a603 100644 --- a/lib/rubocop/cop/chef/style/file_mode.rb +++ b/lib/rubocop/cop/chef/style/file_mode.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Noah Kantrowitz # @@ -30,7 +31,7 @@ module ChefStyle # mode '644' # class FileMode < Cop - MSG = 'Use strings for file modes'.freeze + MSG = 'Use strings for file modes' def_node_matcher :resource_mode?, <<-PATTERN (send nil? :mode $int) diff --git a/lib/rubocop/cop/chef/style/immediate_notification_timing.rb b/lib/rubocop/cop/chef/style/immediate_notification_timing.rb index c4bfe124b..29b82db25 100644 --- a/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +++ b/lib/rubocop/cop/chef/style/immediate_notification_timing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ module ChefStyle # end # class ImmediateNotificationTiming < Cop - MSG = 'Use :immediately instead of :immediate for resource notification timing'.freeze + MSG = 'Use :immediately instead of :immediate for resource notification timing' def_node_matcher :immediate_notify?, <<-PATTERN (send nil? :notifies (sym _) (...) $(sym :immediate)) diff --git a/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb b/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb index 26a159f21..78f3fddeb 100644 --- a/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +++ b/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -32,7 +33,7 @@ module ChefStyle class IncludeRecipeWithParentheses < Base extend RuboCop::Cop::AutoCorrector - MSG = 'There is no need to wrap the recipe in parentheses when using the include_recipe helper'.freeze + MSG = 'There is no need to wrap the recipe in parentheses when using the include_recipe helper' def_node_matcher :include_recipe?, <<-PATTERN (send nil? :include_recipe $(str _)) diff --git a/lib/rubocop/cop/chef/style/negating_only_if.rb b/lib/rubocop/cop/chef/style/negating_only_if.rb index ce71dffc0..d63721dc0 100644 --- a/lib/rubocop/cop/chef/style/negating_only_if.rb +++ b/lib/rubocop/cop/chef/style/negating_only_if.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -33,7 +34,7 @@ module ChefStyle # end # class NegatingOnlyIf < Cop - MSG = 'Instead of using only_if conditionals with ! to negate the returned value, use not_if which is easier to read'.freeze + MSG = 'Instead of using only_if conditionals with ! to negate the returned value, use not_if which is easier to read' def_node_matcher :negated_only_if?, <<-PATTERN (block diff --git a/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb b/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb index d7d2a69e7..5a3d43db1 100644 --- a/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +++ b/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -41,7 +42,7 @@ module ChefStyle # depends 'yum' # class OverlyComplexSupportsDependsMetadata < Cop - MSG = "Don't loop over an array to set cookbook dependencies or supported platforms if you have fewer than three values to set.".freeze + MSG = "Don't loop over an array to set cookbook dependencies or supported platforms if you have fewer than three values to set." def_node_matcher :supports_depends_array?, <<-PATTERN (block diff --git a/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb b/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb index 71aee2d71..336d01fc3 100644 --- a/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +++ b/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -34,7 +35,7 @@ module ChefStyle # if node['platform_version'].to_i == 7 # class SimplifyPlatformMajorVersionCheck < Cop - MSG = "Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]".freeze + MSG = "Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]" def_node_matcher :platform_version_check?, <<-PATTERN (send (send (send nil? :node) :[] (str "platform_version") ) :split (str ".") ) diff --git a/lib/rubocop/cop/chef/style/true_false_resource_properties.rb b/lib/rubocop/cop/chef/style/true_false_resource_properties.rb index 96389a27f..9fcaff6dd 100644 --- a/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +++ b/lib/rubocop/cop/chef/style/true_false_resource_properties.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -29,7 +30,7 @@ module ChefStyle # property :foo, [true, false] # class TrueClassFalseClassResourceProperties < Cop - MSG = "When setting the allowed types for a resource to accept either true or false values it's much simpler to use true and false instead of TrueClass and FalseClass.".freeze + MSG = "When setting the allowed types for a resource to accept either true or false values it's much simpler to use true and false instead of TrueClass and FalseClass." def_node_matcher :trueclass_falseclass_property?, <<-PATTERN (send nil? {:property :attribute} (sym _) $(array (const nil? :TrueClass) (const nil? :FalseClass)) ... ) diff --git a/lib/rubocop/cop/chef/style/unnecessary_os_check.rb b/lib/rubocop/cop/chef/style/unnecessary_os_check.rb index e36566ebe..97d35e4a5 100644 --- a/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +++ b/lib/rubocop/cop/chef/style/unnecessary_os_check.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () @@ -35,7 +36,7 @@ module ChefStyle # platform_family?('netbsd', 'openbsd', 'freebsd) # class UnnecessaryOSCheck < Cop - MSG = "Use the platform_family?() helpers instead of node['os] == 'foo' for platform_families that match 1:1 with OS values.".freeze + MSG = "Use the platform_family?() helpers instead of node['os] == 'foo' for platform_families that match 1:1 with OS values." # sorted list of all the os values that match 1:1 with a platform_family UNNECESSARY_OS_VALUES = %w(aix darwin dragonflybsd freebsd netbsd openbsd solaris2 windows).freeze @@ -89,8 +90,7 @@ def array_from_ast(ast) def autocorrect(node) lambda do |corrector| os_equals?(node) do |operator, plat| - corrected_string = operator == :!= ? '!' : '' - corrected_string << "platform_family?('#{sanitized_platform(plat.value)}')" + corrected_string = (operator == :!= ? '!' : '') + "platform_family?('#{sanitized_platform(plat.value)}')" corrector.replace(node.loc.expression, corrected_string) end diff --git a/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb b/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb index 78f893ef6..04a9c74d4 100644 --- a/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +++ b/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -45,7 +46,7 @@ module ChefStyle class UnnecessaryPlatformCaseStatement < Cop include RangeHelp - MSG = 'Use the platform?() and platform_family?() helpers instead of a case statement that only includes a single when statement.'.freeze + MSG = 'Use the platform?() and platform_family?() helpers instead of a case statement that only includes a single when statement.' def_node_matcher :platform_case?, <<-PATTERN ( case $( send (send nil? :node) :[] $(str {"platform" "platform_family"})) ... ) diff --git a/lib/rubocop/cop/chef/style/use_platform_helpers.rb b/lib/rubocop/cop/chef/style/use_platform_helpers.rb index bcaab4647..d4b0dd2c7 100644 --- a/lib/rubocop/cop/chef/style/use_platform_helpers.rb +++ b/lib/rubocop/cop/chef/style/use_platform_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () @@ -38,7 +39,7 @@ module ChefStyle # platform_family?('rhel', 'suse') # class UsePlatformHelpers < Cop - MSG = "Use platform? and platform_family? helpers to check a node's platform".freeze + MSG = "Use platform? and platform_family? helpers to check a node's platform" def_node_matcher :platform_equals?, <<-PATTERN (send (send (send nil? :node) :[] $(str {"platform" "platform_family"}) ) ${:== :!=} $str ) @@ -69,8 +70,7 @@ def on_send(node) def autocorrect(node) lambda do |corrector| platform_equals?(node) do |type, operator, plat| - corrected_string = operator == :!= ? '!' : '' - corrected_string << "#{type.value}?('#{plat.value}')" + corrected_string = (operator == :!= ? '!' : '') + "#{type.value}?('#{plat.value}')" corrector.replace(node.loc.expression, corrected_string) end diff --git a/lib/rubocop/monkey_patches/comment_config.rb b/lib/rubocop/monkey_patches/comment_config.rb index 871106406..1c03c3cfa 100644 --- a/lib/rubocop/monkey_patches/comment_config.rb +++ b/lib/rubocop/monkey_patches/comment_config.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module RuboCop # we're monkey patching the config regex to allow for # cookstyle: disable whatever # in addition to the # rubocop: disable whatever that comes with RuboCop diff --git a/lib/rubocop/monkey_patches/cop.rb b/lib/rubocop/monkey_patches/cop.rb index cb52b27e2..7f7d87fb7 100644 --- a/lib/rubocop/monkey_patches/cop.rb +++ b/lib/rubocop/monkey_patches/cop.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module RuboCop module Cop class Cop diff --git a/lib/rubocop/monkey_patches/registry_cop.rb b/lib/rubocop/monkey_patches/registry_cop.rb index 70ecaf82f..744a65992 100644 --- a/lib/rubocop/monkey_patches/registry_cop.rb +++ b/lib/rubocop/monkey_patches/registry_cop.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module RuboCop module Cop class Registry diff --git a/spec/rubocop/chef/cookbook_helpers_spec.rb b/spec/rubocop/chef/cookbook_helpers_spec.rb index d86938c1d..7179c40cb 100644 --- a/spec/rubocop/chef/cookbook_helpers_spec.rb +++ b/spec/rubocop/chef/cookbook_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # rubocop:disable Lint/ParenthesesAsGroupedExpression, Lint/BooleanSymbol # # Copyright:: Copyright 2019, Chef Software Inc. diff --git a/spec/rubocop/cop/chef/correctness/block_guard_clause_string_only_spec.rb b/spec/rubocop/cop/chef/correctness/block_guard_clause_string_only_spec.rb index 5f4bdd398..44256263d 100644 --- a/spec/rubocop/cop/chef/correctness/block_guard_clause_string_only_spec.rb +++ b/spec/rubocop/cop/chef/correctness/block_guard_clause_string_only_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/cb_depends_on_self_spec.rb b/spec/rubocop/cop/chef/correctness/cb_depends_on_self_spec.rb index 55af8cbc9..9bdc84af7 100644 --- a/spec/rubocop/cop/chef/correctness/cb_depends_on_self_spec.rb +++ b/spec/rubocop/cop/chef/correctness/cb_depends_on_self_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/chef_application_fatal_spec.rb b/spec/rubocop/cop/chef/correctness/chef_application_fatal_spec.rb index 5ab1dcc5d..ef691dd25 100644 --- a/spec/rubocop/cop/chef/correctness/chef_application_fatal_spec.rb +++ b/spec/rubocop/cop/chef/correctness/chef_application_fatal_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/conditional_ruby_shellout_spec.rb b/spec/rubocop/cop/chef/correctness/conditional_ruby_shellout_spec.rb index 888128044..c28795331 100644 --- a/spec/rubocop/cop/chef/correctness/conditional_ruby_shellout_spec.rb +++ b/spec/rubocop/cop/chef/correctness/conditional_ruby_shellout_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/dnf_package_allow_downgrades_spec.rb b/spec/rubocop/cop/chef/correctness/dnf_package_allow_downgrades_spec.rb index 3a6e483bd..a074511e5 100644 --- a/spec/rubocop/cop/chef/correctness/dnf_package_allow_downgrades_spec.rb +++ b/spec/rubocop/cop/chef/correctness/dnf_package_allow_downgrades_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/incorrect_library_injection_spec.rb b/spec/rubocop/cop/chef/correctness/incorrect_library_injection_spec.rb index 7de8d7138..d4ed1205c 100644 --- a/spec/rubocop/cop/chef/correctness/incorrect_library_injection_spec.rb +++ b/spec/rubocop/cop/chef/correctness/incorrect_library_injection_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019-2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/invalid_notification_timing_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_notification_timing_spec.rb index 4bb790f31..29929b3e8 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_notification_timing_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_notification_timing_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/invalid_platform_family_helper_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_platform_family_helper_spec.rb index 9699a0e95..9a3065f08 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_platform_family_helper_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_platform_family_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case_spec.rb index 79025ab84..8b4b4ef2c 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/invalid_platform_helper_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_platform_helper_spec.rb index e68486e01..1dabcbf17 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_platform_helper_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_platform_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/invalid_platform_metadata_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_platform_metadata_spec.rb index 084ab0e79..aa5b0c73a 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_platform_metadata_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_platform_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/invalid_platform_values_in_case_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_platform_values_in_case_spec.rb index dccea23a2..0f34bdc87 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_platform_values_in_case_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_platform_values_in_case_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper_spec.rb index c84f42b0d..eef93f5af 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_helper_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_helper_spec.rb index 7d19b169b..37051fd7b 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_helper_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_value_for_platform_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/invalid_version_metadata_spec.rb b/spec/rubocop/cop/chef/correctness/invalid_version_metadata_spec.rb index 7e34b3722..f05023007 100644 --- a/spec/rubocop/cop/chef/correctness/invalid_version_metadata_spec.rb +++ b/spec/rubocop/cop/chef/correctness/invalid_version_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults_spec.rb b/spec/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults_spec.rb index 50add5015..844c85f43 100644 --- a/spec/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults_spec.rb +++ b/spec/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/malformed_value_for_platform_spec.rb b/spec/rubocop/cop/chef/correctness/malformed_value_for_platform_spec.rb index 87814759e..bd15c810a 100644 --- a/spec/rubocop/cop/chef/correctness/malformed_value_for_platform_spec.rb +++ b/spec/rubocop/cop/chef/correctness/malformed_value_for_platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/metadata_missing_name_spec.rb b/spec/rubocop/cop/chef/correctness/metadata_missing_name_spec.rb index 9996056bd..2a35c9db7 100644 --- a/spec/rubocop/cop/chef/correctness/metadata_missing_name_spec.rb +++ b/spec/rubocop/cop/chef/correctness/metadata_missing_name_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/node_normal_spec.rb b/spec/rubocop/cop/chef/correctness/node_normal_spec.rb index 3c2736215..a2d38784d 100644 --- a/spec/rubocop/cop/chef/correctness/node_normal_spec.rb +++ b/spec/rubocop/cop/chef/correctness/node_normal_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/cop/chef/correctness/node_normal_unless_spec.rb b/spec/rubocop/cop/chef/correctness/node_normal_unless_spec.rb index 678e2910d..8aae388c2 100644 --- a/spec/rubocop/cop/chef/correctness/node_normal_unless_spec.rb +++ b/spec/rubocop/cop/chef/correctness/node_normal_unless_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/cop/chef/correctness/node_save_spec.rb b/spec/rubocop/cop/chef/correctness/node_save_spec.rb index 621b9fb08..4047f8810 100644 --- a/spec/rubocop/cop/chef/correctness/node_save_spec.rb +++ b/spec/rubocop/cop/chef/correctness/node_save_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/correctness/notifies_action_not_symbol_spec.rb b/spec/rubocop/cop/chef/correctness/notifies_action_not_symbol_spec.rb index 04b82a878..9cf25d062 100644 --- a/spec/rubocop/cop/chef/correctness/notifies_action_not_symbol_spec.rb +++ b/spec/rubocop/cop/chef/correctness/notifies_action_not_symbol_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/openssl_password_helpers_spec.rb b/spec/rubocop/cop/chef/correctness/openssl_password_helpers_spec.rb index e5d4b85be..b060c8ce1 100644 --- a/spec/rubocop/cop/chef/correctness/openssl_password_helpers_spec.rb +++ b/spec/rubocop/cop/chef/correctness/openssl_password_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/powershell_delete_file_spec.rb b/spec/rubocop/cop/chef/correctness/powershell_delete_file_spec.rb index a61db9c29..e113a05e8 100644 --- a/spec/rubocop/cop/chef/correctness/powershell_delete_file_spec.rb +++ b/spec/rubocop/cop/chef/correctness/powershell_delete_file_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/resource_sets_internal_properties_spec.rb b/spec/rubocop/cop/chef/correctness/resource_sets_internal_properties_spec.rb index 847c4e947..850926674 100644 --- a/spec/rubocop/cop/chef/correctness/resource_sets_internal_properties_spec.rb +++ b/spec/rubocop/cop/chef/correctness/resource_sets_internal_properties_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # diff --git a/spec/rubocop/cop/chef/correctness/resource_sets_name_property_spec.rb b/spec/rubocop/cop/chef/correctness/resource_sets_name_property_spec.rb index b92868ede..a61f15233 100644 --- a/spec/rubocop/cop/chef/correctness/resource_sets_name_property_spec.rb +++ b/spec/rubocop/cop/chef/correctness/resource_sets_name_property_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # diff --git a/spec/rubocop/cop/chef/correctness/resource_with_none_action_spec.rb b/spec/rubocop/cop/chef/correctness/resource_with_none_action_spec.rb index fe435900c..099caea12 100644 --- a/spec/rubocop/cop/chef/correctness/resource_with_none_action_spec.rb +++ b/spec/rubocop/cop/chef/correctness/resource_with_none_action_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # diff --git a/spec/rubocop/cop/chef/correctness/scoped_file_exist_spec.rb b/spec/rubocop/cop/chef/correctness/scoped_file_exist_spec.rb index b57d3f015..91928b210 100644 --- a/spec/rubocop/cop/chef/correctness/scoped_file_exist_spec.rb +++ b/spec/rubocop/cop/chef/correctness/scoped_file_exist_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/correctness/service_resource_spec.rb b/spec/rubocop/cop/chef/correctness/service_resource_spec.rb index 39b41defb..c6014c837 100644 --- a/spec/rubocop/cop/chef/correctness/service_resource_spec.rb +++ b/spec/rubocop/cop/chef/correctness/service_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # diff --git a/spec/rubocop/cop/chef/correctness/tmp_path_spec.rb b/spec/rubocop/cop/chef/correctness/tmp_path_spec.rb index 44cc024a5..2c2f66161 100644 --- a/spec/rubocop/cop/chef/correctness/tmp_path_spec.rb +++ b/spec/rubocop/cop/chef/correctness/tmp_path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # diff --git a/spec/rubocop/cop/chef/deprecation/chef_handler_recipe_spec.rb b/spec/rubocop/cop/chef/deprecation/chef_handler_recipe_spec.rb index 6c68e4d9b..4c79ebb54 100644 --- a/spec/rubocop/cop/chef/deprecation/chef_handler_recipe_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chef_handler_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/chef_handler_supports_spec.rb b/spec/rubocop/cop/chef/deprecation/chef_handler_supports_spec.rb index 715f26251..a09a16234 100644 --- a/spec/rubocop/cop/chef/deprecation/chef_handler_supports_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chef_handler_supports_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/chef_rest_spec.rb b/spec/rubocop/cop/chef/deprecation/chef_rest_spec.rb index 7b836a999..ef5e7c6ba 100644 --- a/spec/rubocop/cop/chef/deprecation/chef_rest_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chef_rest_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/chef_rewind_spec.rb b/spec/rubocop/cop/chef/deprecation/chef_rewind_spec.rb index 31494ad9c..8ddca8d5b 100644 --- a/spec/rubocop/cop/chef/deprecation/chef_rewind_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chef_rewind_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/chef_windows_platform_helper_spec.rb b/spec/rubocop/cop/chef/deprecation/chef_windows_platform_helper_spec.rb index aaf8e37ca..3a8cfc649 100644 --- a/spec/rubocop/cop/chef/deprecation/chef_windows_platform_helper_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chef_windows_platform_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/chefdk_generators_spec.rb b/spec/rubocop/cop/chef/deprecation/chefdk_generators_spec.rb index 1866ba326..ed4168287 100644 --- a/spec/rubocop/cop/chef/deprecation/chefdk_generators_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chefdk_generators_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/cheffile_spec.rb b/spec/rubocop/cop/chef/deprecation/cheffile_spec.rb index 14471ab91..8d8ea0074 100644 --- a/spec/rubocop/cop/chef/deprecation/cheffile_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/cheffile_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/chefspec_coverage_report_spec.rb b/spec/rubocop/cop/chef/deprecation/chefspec_coverage_report_spec.rb index 45ec7eb70..798e3f63c 100644 --- a/spec/rubocop/cop/chef/deprecation/chefspec_coverage_report_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chefspec_coverage_report_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/chefspec_legacy_runner_spec.rb b/spec/rubocop/cop/chef/deprecation/chefspec_legacy_runner_spec.rb index dc1686690..a480fa603 100644 --- a/spec/rubocop/cop/chef/deprecation/chefspec_legacy_runner_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chefspec_legacy_runner_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action_spec.rb b/spec/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action_spec.rb index fea1ed4bf..ae9986221 100644 --- a/spec/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/depends_compat_resource_spec.rb b/spec/rubocop/cop/chef/deprecation/depends_compat_resource_spec.rb index 9f3db0b08..bdc1394c4 100644 --- a/spec/rubocop/cop/chef/deprecation/depends_compat_resource_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/depends_compat_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/depends_partial_search_spec.rb b/spec/rubocop/cop/chef/deprecation/depends_partial_search_spec.rb index b9e517c3a..d146f5243 100644 --- a/spec/rubocop/cop/chef/deprecation/depends_partial_search_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/depends_partial_search_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/depends_poise_spec.rb b/spec/rubocop/cop/chef/deprecation/depends_poise_spec.rb index 4dd784731..244c3e3c4 100644 --- a/spec/rubocop/cop/chef/deprecation/depends_poise_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/depends_poise_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/deprecated_chefspec_platform_spec.rb b/spec/rubocop/cop/chef/deprecation/deprecated_chefspec_platform_spec.rb index 2b16d46d7..7d39e9c52 100644 --- a/spec/rubocop/cop/chef/deprecation/deprecated_chefspec_platform_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/deprecated_chefspec_platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/deprecated_mixins_spec.rb b/spec/rubocop/cop/chef/deprecation/deprecated_mixins_spec.rb index 2b6822273..f145a6a8c 100644 --- a/spec/rubocop/cop/chef/deprecation/deprecated_mixins_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/deprecated_mixins_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/deprecated_platform_methods_spec.rb b/spec/rubocop/cop/chef/deprecation/deprecated_platform_methods_spec.rb index 7fbdc025c..fdcf57dac 100644 --- a/spec/rubocop/cop/chef/deprecation/deprecated_platform_methods_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/deprecated_platform_methods_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/deprecated_shellout_methods_spec.rb b/spec/rubocop/cop/chef/deprecation/deprecated_shellout_methods_spec.rb index e5ef17026..dda1b4794 100644 --- a/spec/rubocop/cop/chef/deprecation/deprecated_shellout_methods_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/deprecated_shellout_methods_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/deprecated_windows_version_check_spec.rb b/spec/rubocop/cop/chef/deprecation/deprecated_windows_version_check_spec.rb index e1391de7d..29a4bc491 100644 --- a/spec/rubocop/cop/chef/deprecation/deprecated_windows_version_check_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/deprecated_windows_version_check_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties_spec.rb b/spec/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties_spec.rb index b16d986d3..140e4dbfa 100644 --- a/spec/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/easy_install_spec.rb b/spec/rubocop/cop/chef/deprecation/easy_install_spec.rb index 09dca6e5a..440a27eaf 100644 --- a/spec/rubocop/cop/chef/deprecation/easy_install_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/easy_install_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/eol_audit_mode_spec.rb b/spec/rubocop/cop/chef/deprecation/eol_audit_mode_spec.rb index 3923b5003..306292705 100644 --- a/spec/rubocop/cop/chef/deprecation/eol_audit_mode_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/eol_audit_mode_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/epic_fail_spec.rb b/spec/rubocop/cop/chef/deprecation/epic_fail_spec.rb index 89dd741c6..019d19304 100644 --- a/spec/rubocop/cop/chef/deprecation/epic_fail_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/epic_fail_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/erl_call_spec.rb b/spec/rubocop/cop/chef/deprecation/erl_call_spec.rb index 33c732203..a97565c6c 100644 --- a/spec/rubocop/cop/chef/deprecation/erl_call_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/erl_call_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/hwrp_without_provides_spec.rb b/spec/rubocop/cop/chef/deprecation/hwrp_without_provides_spec.rb index c33af41cd..c2934b914 100644 --- a/spec/rubocop/cop/chef/deprecation/hwrp_without_provides_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/hwrp_without_provides_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright (c) Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/inherits_compat_resource_spec.rb b/spec/rubocop/cop/chef/deprecation/inherits_compat_resource_spec.rb index b0003342a..6938e64f5 100644 --- a/spec/rubocop/cop/chef/deprecation/inherits_compat_resource_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/inherits_compat_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property_spec.rb b/spec/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property_spec.rb index 03838da60..d00aa1978 100644 --- a/spec/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/legacy_notify_syntax_spec.rb b/spec/rubocop/cop/chef/deprecation/legacy_notify_syntax_spec.rb index 296827349..db841e7f9 100644 --- a/spec/rubocop/cop/chef/deprecation/legacy_notify_syntax_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/legacy_notify_syntax_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/legacy_yum_cookbook_spec.rb b/spec/rubocop/cop/chef/deprecation/legacy_yum_cookbook_spec.rb index be83d84f5..74dd0d986 100644 --- a/spec/rubocop/cop/chef/deprecation/legacy_yum_cookbook_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/legacy_yum_cookbook_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/locale_lc_all_property_spec.rb b/spec/rubocop/cop/chef/deprecation/locale_lc_all_property_spec.rb index 0aec354e7..4a797ae9a 100644 --- a/spec/rubocop/cop/chef/deprecation/locale_lc_all_property_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/locale_lc_all_property_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/log_resource_notification_spec.rb b/spec/rubocop/cop/chef/deprecation/log_resource_notification_spec.rb index 85bd792be..af79ca485 100644 --- a/spec/rubocop/cop/chef/deprecation/log_resource_notification_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/log_resource_notification_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/name_property_and_default_spec.rb b/spec/rubocop/cop/chef/deprecation/name_property_and_default_spec.rb index 568447daf..38b8fe747 100644 --- a/spec/rubocop/cop/chef/deprecation/name_property_and_default_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/name_property_and_default_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/node_deep_fetch_spec.rb b/spec/rubocop/cop/chef/deprecation/node_deep_fetch_spec.rb index d06448470..53173130b 100644 --- a/spec/rubocop/cop/chef/deprecation/node_deep_fetch_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/node_deep_fetch_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/node_methods_not_attributes_spec.rb b/spec/rubocop/cop/chef/deprecation/node_methods_not_attributes_spec.rb index 745c037c3..a7dfe1bf2 100644 --- a/spec/rubocop/cop/chef/deprecation/node_methods_not_attributes_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/node_methods_not_attributes_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/node_set_spec.rb b/spec/rubocop/cop/chef/deprecation/node_set_spec.rb index d8caa0fec..99df7480b 100644 --- a/spec/rubocop/cop/chef/deprecation/node_set_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/node_set_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/node_set_unless_spec.rb b/spec/rubocop/cop/chef/deprecation/node_set_unless_spec.rb index 567448099..26ee94fb9 100644 --- a/spec/rubocop/cop/chef/deprecation/node_set_unless_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/node_set_unless_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/node_set_without_level_spec.rb b/spec/rubocop/cop/chef/deprecation/node_set_without_level_spec.rb index 97b723e54..3ef0d5662 100644 --- a/spec/rubocop/cop/chef/deprecation/node_set_without_level_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/node_set_without_level_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/partial_search_class_usage_spec.rb b/spec/rubocop/cop/chef/deprecation/partial_search_class_usage_spec.rb index 1678a4e46..82e308e1a 100644 --- a/spec/rubocop/cop/chef/deprecation/partial_search_class_usage_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/partial_search_class_usage_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/partial_search_helper_usage_spec.rb b/spec/rubocop/cop/chef/deprecation/partial_search_helper_usage_spec.rb index 67b5e7de7..ab33c484b 100644 --- a/spec/rubocop/cop/chef/deprecation/partial_search_helper_usage_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/partial_search_helper_usage_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/poise_archive_spec.rb b/spec/rubocop/cop/chef/deprecation/poise_archive_spec.rb index f80ee1574..0d4579fe4 100644 --- a/spec/rubocop/cop/chef/deprecation/poise_archive_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/poise_archive_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/powershell_cookbook_helpers_spec.rb b/spec/rubocop/cop/chef/deprecation/powershell_cookbook_helpers_spec.rb index 197e911f2..6483500c3 100644 --- a/spec/rubocop/cop/chef/deprecation/powershell_cookbook_helpers_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/powershell_cookbook_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/require_recipe_spec.rb b/spec/rubocop/cop/chef/deprecation/require_recipe_spec.rb index aa6aa7785..95c3356e8 100644 --- a/spec/rubocop/cop/chef/deprecation/require_recipe_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/require_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/resource_overrides_provides_method_spec.rb b/spec/rubocop/cop/chef/deprecation/resource_overrides_provides_method_spec.rb index fe62be63a..48f2b15f5 100644 --- a/spec/rubocop/cop/chef/deprecation/resource_overrides_provides_method_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/resource_overrides_provides_method_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method_spec.rb b/spec/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method_spec.rb index f07353e36..3e167f87f 100644 --- a/spec/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/resource_uses_only_resource_name_spec.rb b/spec/rubocop/cop/chef/deprecation/resource_uses_only_resource_name_spec.rb index 325933a4f..9f99f9cea 100644 --- a/spec/rubocop/cop/chef/deprecation/resource_uses_only_resource_name_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/resource_uses_only_resource_name_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright (c) Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/resource_uses_provider_base_method_spec.rb b/spec/rubocop/cop/chef/deprecation/resource_uses_provider_base_method_spec.rb index d6e8ed94a..c58a3553f 100644 --- a/spec/rubocop/cop/chef/deprecation/resource_uses_provider_base_method_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/resource_uses_provider_base_method_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/resource_uses_updated_method_spec.rb b/spec/rubocop/cop/chef/deprecation/resource_uses_updated_method_spec.rb index 45943cefa..30f574c60 100644 --- a/spec/rubocop/cop/chef/deprecation/resource_uses_updated_method_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/resource_uses_updated_method_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings_spec.rb b/spec/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings_spec.rb index fb90b8e5d..6ed847aa4 100644 --- a/spec/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/ruby_block_create_action_spec.rb b/spec/rubocop/cop/chef/deprecation/ruby_block_create_action_spec.rb index f3a5ef1fd..be14a1b44 100644 --- a/spec/rubocop/cop/chef/deprecation/ruby_block_create_action_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/ruby_block_create_action_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/run_command_helper_spec.rb b/spec/rubocop/cop/chef/deprecation/run_command_helper_spec.rb index 17ba4461f..6fcc0b281 100644 --- a/spec/rubocop/cop/chef/deprecation/run_command_helper_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/run_command_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/search_uses_positional_parameters_spec.rb b/spec/rubocop/cop/chef/deprecation/search_uses_positional_parameters_spec.rb index 70d9a7547..2de2b7a5d 100644 --- a/spec/rubocop/cop/chef/deprecation/search_uses_positional_parameters_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/search_uses_positional_parameters_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/use_automatic_resource_name_spec.rb b/spec/rubocop/cop/chef/deprecation/use_automatic_resource_name_spec.rb index 0deb9cd75..ab99b4817 100644 --- a/spec/rubocop/cop/chef/deprecation/use_automatic_resource_name_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/use_automatic_resource_name_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/use_inline_resources_spec.rb b/spec/rubocop/cop/chef/deprecation/use_inline_resources_spec.rb index e0a623987..04ef301ef 100644 --- a/spec/rubocop/cop/chef/deprecation/use_inline_resources_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/use_inline_resources_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/user_supports_property_spec.rb b/spec/rubocop/cop/chef/deprecation/user_supports_property_spec.rb index 93ffc7239..efa7fb111 100644 --- a/spec/rubocop/cop/chef/deprecation/user_supports_property_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/user_supports_property_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/verify_property_file_expansion_spec.rb b/spec/rubocop/cop/chef/deprecation/verify_property_file_expansion_spec.rb index 9bbbcfac5..8ad91b9c3 100644 --- a/spec/rubocop/cop/chef/deprecation/verify_property_file_expansion_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/verify_property_file_expansion_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd_spec.rb b/spec/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd_spec.rb index bb0ca47d3..01d4a6f34 100644 --- a/spec/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/windows_task_change_action_spec.rb b/spec/rubocop/cop/chef/deprecation/windows_task_change_action_spec.rb index d085a8dec..eecb22edb 100644 --- a/spec/rubocop/cop/chef/deprecation/windows_task_change_action_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/windows_task_change_action_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/windows_version_helpers_spec.rb b/spec/rubocop/cop/chef/deprecation/windows_version_helpers_spec.rb index fefda7fac..f6f9dea69 100644 --- a/spec/rubocop/cop/chef/deprecation/windows_version_helpers_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/windows_version_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/deprecation/xml_ruby_recipe_spec.rb b/spec/rubocop/cop/chef/deprecation/xml_ruby_recipe_spec.rb index 49bcf8bfb..452d68b6b 100644 --- a/spec/rubocop/cop/chef/deprecation/xml_ruby_recipe_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/xml_ruby_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe_spec.rb b/spec/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe_spec.rb index 9fb9a23aa..910e746e9 100644 --- a/spec/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe_spec.rb +++ b/spec/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/effortless/Berksfile_spec.rb b/spec/rubocop/cop/chef/effortless/Berksfile_spec.rb index c88ac3b6b..021f4b8b0 100644 --- a/spec/rubocop/cop/chef/effortless/Berksfile_spec.rb +++ b/spec/rubocop/cop/chef/effortless/Berksfile_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/effortless/data_bag_used_spec.rb b/spec/rubocop/cop/chef/effortless/data_bag_used_spec.rb index dd108d366..47a995f2a 100644 --- a/spec/rubocop/cop/chef/effortless/data_bag_used_spec.rb +++ b/spec/rubocop/cop/chef/effortless/data_bag_used_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/effortless/node_environment_spec.rb b/spec/rubocop/cop/chef/effortless/node_environment_spec.rb index e152a9223..db21f13f4 100644 --- a/spec/rubocop/cop/chef/effortless/node_environment_spec.rb +++ b/spec/rubocop/cop/chef/effortless/node_environment_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/effortless/node_policygroup_spec.rb b/spec/rubocop/cop/chef/effortless/node_policygroup_spec.rb index cb5e486cf..02e36f605 100644 --- a/spec/rubocop/cop/chef/effortless/node_policygroup_spec.rb +++ b/spec/rubocop/cop/chef/effortless/node_policygroup_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/effortless/node_roles_spec.rb b/spec/rubocop/cop/chef/effortless/node_roles_spec.rb index 1aba807ec..ab6f42013 100644 --- a/spec/rubocop/cop/chef/effortless/node_roles_spec.rb +++ b/spec/rubocop/cop/chef/effortless/node_roles_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/effortless/search_for_environments_or_roles_spec.rb b/spec/rubocop/cop/chef/effortless/search_for_environments_or_roles_spec.rb index 3ddc8cf32..a5aa9e255 100644 --- a/spec/rubocop/cop/chef/effortless/search_for_environments_or_roles_spec.rb +++ b/spec/rubocop/cop/chef/effortless/search_for_environments_or_roles_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/effortless/search_used_spec.rb b/spec/rubocop/cop/chef/effortless/search_used_spec.rb index 7068ace1c..4c152a9f3 100644 --- a/spec/rubocop/cop/chef/effortless/search_used_spec.rb +++ b/spec/rubocop/cop/chef/effortless/search_used_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/allowed_actions_initializer_spec.rb b/spec/rubocop/cop/chef/modernize/allowed_actions_initializer_spec.rb index 36c260f87..9d6900f81 100644 --- a/spec/rubocop/cop/chef/modernize/allowed_actions_initializer_spec.rb +++ b/spec/rubocop/cop/chef/modernize/allowed_actions_initializer_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/apt_default_recipe_spec.rb b/spec/rubocop/cop/chef/modernize/apt_default_recipe_spec.rb index fdf56b24e..6dce397b1 100644 --- a/spec/rubocop/cop/chef/modernize/apt_default_recipe_spec.rb +++ b/spec/rubocop/cop/chef/modernize/apt_default_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/berksfile_source_spec.rb b/spec/rubocop/cop/chef/modernize/berksfile_source_spec.rb index 64b9f078a..b44a6fd5b 100644 --- a/spec/rubocop/cop/chef/modernize/berksfile_source_spec.rb +++ b/spec/rubocop/cop/chef/modernize/berksfile_source_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/build_essential_spec.rb b/spec/rubocop/cop/chef/modernize/build_essential_spec.rb index 9bff2255f..0e857b941 100644 --- a/spec/rubocop/cop/chef/modernize/build_essential_spec.rb +++ b/spec/rubocop/cop/chef/modernize/build_essential_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/chef_14_resources_spec.rb b/spec/rubocop/cop/chef/modernize/chef_14_resources_spec.rb index 3dd487a08..646b9e521 100644 --- a/spec/rubocop/cop/chef/modernize/chef_14_resources_spec.rb +++ b/spec/rubocop/cop/chef/modernize/chef_14_resources_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/chef_gem_nokogiri_spec.rb b/spec/rubocop/cop/chef/modernize/chef_gem_nokogiri_spec.rb index a735e1efc..bf789d722 100644 --- a/spec/rubocop/cop/chef/modernize/chef_gem_nokogiri_spec.rb +++ b/spec/rubocop/cop/chef/modernize/chef_gem_nokogiri_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/compile_time_resources_spec.rb b/spec/rubocop/cop/chef/modernize/compile_time_resources_spec.rb index d787363e9..669ba7345 100644 --- a/spec/rubocop/cop/chef/modernize/compile_time_resources_spec.rb +++ b/spec/rubocop/cop/chef/modernize/compile_time_resources_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/conditional_using_test_spec.rb b/spec/rubocop/cop/chef/modernize/conditional_using_test_spec.rb index 1ad197134..cbd014f89 100644 --- a/spec/rubocop/cop/chef/modernize/conditional_using_test_spec.rb +++ b/spec/rubocop/cop/chef/modernize/conditional_using_test_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/cron_manage_resource_spec.rb b/spec/rubocop/cop/chef/modernize/cron_manage_resource_spec.rb index 48c226e1b..5d62e39fe 100644 --- a/spec/rubocop/cop/chef/modernize/cron_manage_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/cron_manage_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/databag_helpers_spec.rb b/spec/rubocop/cop/chef/modernize/databag_helpers_spec.rb index 70240ddfc..7fbfbf549 100644 --- a/spec/rubocop/cop/chef/modernize/databag_helpers_spec.rb +++ b/spec/rubocop/cop/chef/modernize/databag_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/default_action_initializer_spec.rb b/spec/rubocop/cop/chef/modernize/default_action_initializer_spec.rb index 03f1da763..1b23a8fb9 100644 --- a/spec/rubocop/cop/chef/modernize/default_action_initializer_spec.rb +++ b/spec/rubocop/cop/chef/modernize/default_action_initializer_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/defines_chefspec_matchers_spec.rb b/spec/rubocop/cop/chef/modernize/defines_chefspec_matchers_spec.rb index 56af51740..fb64985ac 100644 --- a/spec/rubocop/cop/chef/modernize/defines_chefspec_matchers_spec.rb +++ b/spec/rubocop/cop/chef/modernize/defines_chefspec_matchers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/definitions_spec.rb b/spec/rubocop/cop/chef/modernize/definitions_spec.rb index ba99f609a..76e80f791 100644 --- a/spec/rubocop/cop/chef/modernize/definitions_spec.rb +++ b/spec/rubocop/cop/chef/modernize/definitions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/depends_zypper_cookbook_spec.rb b/spec/rubocop/cop/chef/modernize/depends_zypper_cookbook_spec.rb index 4fc780aa7..43d60e465 100644 --- a/spec/rubocop/cop/chef/modernize/depends_zypper_cookbook_spec.rb +++ b/spec/rubocop/cop/chef/modernize/depends_zypper_cookbook_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/dsl_include_in_resource_spec.rb b/spec/rubocop/cop/chef/modernize/dsl_include_in_resource_spec.rb index 8e4dd90b9..e56b37b42 100644 --- a/spec/rubocop/cop/chef/modernize/dsl_include_in_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/dsl_include_in_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/empty_resource_initialize_spec.rb b/spec/rubocop/cop/chef/modernize/empty_resource_initialize_spec.rb index d523dc120..ebee0397a 100644 --- a/spec/rubocop/cop/chef/modernize/empty_resource_initialize_spec.rb +++ b/spec/rubocop/cop/chef/modernize/empty_resource_initialize_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/execute_apt_update_spec.rb b/spec/rubocop/cop/chef/modernize/execute_apt_update_spec.rb index ccacf899b..505e7475e 100644 --- a/spec/rubocop/cop/chef/modernize/execute_apt_update_spec.rb +++ b/spec/rubocop/cop/chef/modernize/execute_apt_update_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/execute_sc_exe_spec.rb b/spec/rubocop/cop/chef/modernize/execute_sc_exe_spec.rb index 13e06e2bc..c5d2b048c 100644 --- a/spec/rubocop/cop/chef/modernize/execute_sc_exe_spec.rb +++ b/spec/rubocop/cop/chef/modernize/execute_sc_exe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/execute_sleep_spec.rb b/spec/rubocop/cop/chef/modernize/execute_sleep_spec.rb index f768a33ef..51d4f52c5 100644 --- a/spec/rubocop/cop/chef/modernize/execute_sleep_spec.rb +++ b/spec/rubocop/cop/chef/modernize/execute_sleep_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/execute_sysctl_spec.rb b/spec/rubocop/cop/chef/modernize/execute_sysctl_spec.rb index f56281f99..9aaf75ecd 100644 --- a/spec/rubocop/cop/chef/modernize/execute_sysctl_spec.rb +++ b/spec/rubocop/cop/chef/modernize/execute_sysctl_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/execute_tzutil_spec.rb b/spec/rubocop/cop/chef/modernize/execute_tzutil_spec.rb index 1ee5a412e..7155e835c 100644 --- a/spec/rubocop/cop/chef/modernize/execute_tzutil_spec.rb +++ b/spec/rubocop/cop/chef/modernize/execute_tzutil_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/foodcritic_comments_spec.rb b/spec/rubocop/cop/chef/modernize/foodcritic_comments_spec.rb index 68e97b3be..297d97cfe 100644 --- a/spec/rubocop/cop/chef/modernize/foodcritic_comments_spec.rb +++ b/spec/rubocop/cop/chef/modernize/foodcritic_comments_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/if_provides_default_action_spec.rb b/spec/rubocop/cop/chef/modernize/if_provides_default_action_spec.rb index 2d15c9c74..229214712 100644 --- a/spec/rubocop/cop/chef/modernize/if_provides_default_action_spec.rb +++ b/spec/rubocop/cop/chef/modernize/if_provides_default_action_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/includes_mixin_shellout_spec.rb b/spec/rubocop/cop/chef/modernize/includes_mixin_shellout_spec.rb index 2443e0ad0..730e7c83a 100644 --- a/spec/rubocop/cop/chef/modernize/includes_mixin_shellout_spec.rb +++ b/spec/rubocop/cop/chef/modernize/includes_mixin_shellout_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/libarchive_file_spec.rb b/spec/rubocop/cop/chef/modernize/libarchive_file_spec.rb index 2a321a79e..fb0bb347f 100644 --- a/spec/rubocop/cop/chef/modernize/libarchive_file_spec.rb +++ b/spec/rubocop/cop/chef/modernize/libarchive_file_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/macos_user_defaults_spec.rb b/spec/rubocop/cop/chef/modernize/macos_user_defaults_spec.rb index b8b68f16c..cdc8e7fb6 100644 --- a/spec/rubocop/cop/chef/modernize/macos_user_defaults_spec.rb +++ b/spec/rubocop/cop/chef/modernize/macos_user_defaults_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/minitest_handler_usage_spec.rb b/spec/rubocop/cop/chef/modernize/minitest_handler_usage_spec.rb index ea2deb451..de034e437 100644 --- a/spec/rubocop/cop/chef/modernize/minitest_handler_usage_spec.rb +++ b/spec/rubocop/cop/chef/modernize/minitest_handler_usage_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/node_init_package_spec.rb b/spec/rubocop/cop/chef/modernize/node_init_package_spec.rb index eb235f5a2..df8a4bff5 100644 --- a/spec/rubocop/cop/chef/modernize/node_init_package_spec.rb +++ b/spec/rubocop/cop/chef/modernize/node_init_package_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/node_roles_include_spec.rb b/spec/rubocop/cop/chef/modernize/node_roles_include_spec.rb index 2f89f573d..5e314144e 100644 --- a/spec/rubocop/cop/chef/modernize/node_roles_include_spec.rb +++ b/spec/rubocop/cop/chef/modernize/node_roles_include_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/ohai_default_recipe_spec.rb b/spec/rubocop/cop/chef/modernize/ohai_default_recipe_spec.rb index bd0bde615..c84e5f137 100644 --- a/spec/rubocop/cop/chef/modernize/ohai_default_recipe_spec.rb +++ b/spec/rubocop/cop/chef/modernize/ohai_default_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/openssl_rsa_key_resource_spec.rb b/spec/rubocop/cop/chef/modernize/openssl_rsa_key_resource_spec.rb index 1819b6b05..ea2e86974 100644 --- a/spec/rubocop/cop/chef/modernize/openssl_rsa_key_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/openssl_rsa_key_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/openssl_x509_resource_spec.rb b/spec/rubocop/cop/chef/modernize/openssl_x509_resource_spec.rb index fdb31f65a..5ed2e9564 100644 --- a/spec/rubocop/cop/chef/modernize/openssl_x509_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/openssl_x509_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/osx_config_profile_resource_spec.rb b/spec/rubocop/cop/chef/modernize/osx_config_profile_resource_spec.rb index d964c02fa..9889dfa3a 100644 --- a/spec/rubocop/cop/chef/modernize/osx_config_profile_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/osx_config_profile_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/powershell_expand_archive_spec.rb b/spec/rubocop/cop/chef/modernize/powershell_expand_archive_spec.rb index bb85d5c1a..c01c88ae5 100644 --- a/spec/rubocop/cop/chef/modernize/powershell_expand_archive_spec.rb +++ b/spec/rubocop/cop/chef/modernize/powershell_expand_archive_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/powershell_guard_interpreter_spec.rb b/spec/rubocop/cop/chef/modernize/powershell_guard_interpreter_spec.rb index bf69e2d6b..180732d97 100644 --- a/spec/rubocop/cop/chef/modernize/powershell_guard_interpreter_spec.rb +++ b/spec/rubocop/cop/chef/modernize/powershell_guard_interpreter_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/powershell_install_package_spec.rb b/spec/rubocop/cop/chef/modernize/powershell_install_package_spec.rb index 3400036da..93f1fe613 100644 --- a/spec/rubocop/cop/chef/modernize/powershell_install_package_spec.rb +++ b/spec/rubocop/cop/chef/modernize/powershell_install_package_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/powershell_install_windowsfeature_spec.rb b/spec/rubocop/cop/chef/modernize/powershell_install_windowsfeature_spec.rb index 55f0aab26..0bcb83469 100644 --- a/spec/rubocop/cop/chef/modernize/powershell_install_windowsfeature_spec.rb +++ b/spec/rubocop/cop/chef/modernize/powershell_install_windowsfeature_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/property_with_name_attribute_spec.rb b/spec/rubocop/cop/chef/modernize/property_with_name_attribute_spec.rb index f25c9e5e3..368d78501 100644 --- a/spec/rubocop/cop/chef/modernize/property_with_name_attribute_spec.rb +++ b/spec/rubocop/cop/chef/modernize/property_with_name_attribute_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/provides_initializer_spec.rb b/spec/rubocop/cop/chef/modernize/provides_initializer_spec.rb index dbc5e77d8..39012d9b0 100644 --- a/spec/rubocop/cop/chef/modernize/provides_initializer_spec.rb +++ b/spec/rubocop/cop/chef/modernize/provides_initializer_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/resource_name_initializer_spec.rb b/spec/rubocop/cop/chef/modernize/resource_name_initializer_spec.rb index 0381cc445..df763fb20 100644 --- a/spec/rubocop/cop/chef/modernize/resource_name_initializer_spec.rb +++ b/spec/rubocop/cop/chef/modernize/resource_name_initializer_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/resource_set_or_return_spec.rb b/spec/rubocop/cop/chef/modernize/resource_set_or_return_spec.rb index 461946e91..365b182a1 100644 --- a/spec/rubocop/cop/chef/modernize/resource_set_or_return_spec.rb +++ b/spec/rubocop/cop/chef/modernize/resource_set_or_return_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/resource_with_attributes_spec.rb b/spec/rubocop/cop/chef/modernize/resource_with_attributes_spec.rb index b1e837947..efb841736 100644 --- a/spec/rubocop/cop/chef/modernize/resource_with_attributes_spec.rb +++ b/spec/rubocop/cop/chef/modernize/resource_with_attributes_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/respond_to_compile_time_spec.rb b/spec/rubocop/cop/chef/modernize/respond_to_compile_time_spec.rb index 88fea5dcc..93508ca5f 100644 --- a/spec/rubocop/cop/chef/modernize/respond_to_compile_time_spec.rb +++ b/spec/rubocop/cop/chef/modernize/respond_to_compile_time_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/respond_to_metadata_spec.rb b/spec/rubocop/cop/chef/modernize/respond_to_metadata_spec.rb index 863bb51d1..770c369fc 100644 --- a/spec/rubocop/cop/chef/modernize/respond_to_metadata_spec.rb +++ b/spec/rubocop/cop/chef/modernize/respond_to_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/respond_to_provides_spec.rb b/spec/rubocop/cop/chef/modernize/respond_to_provides_spec.rb index 054183bbe..6d04d9659 100644 --- a/spec/rubocop/cop/chef/modernize/respond_to_provides_spec.rb +++ b/spec/rubocop/cop/chef/modernize/respond_to_provides_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/respond_to_resource_name_spec.rb b/spec/rubocop/cop/chef/modernize/respond_to_resource_name_spec.rb index 0ff559a95..f9e26f6bc 100644 --- a/spec/rubocop/cop/chef/modernize/respond_to_resource_name_spec.rb +++ b/spec/rubocop/cop/chef/modernize/respond_to_resource_name_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/sc_windows_resource_spec.rb b/spec/rubocop/cop/chef/modernize/sc_windows_resource_spec.rb index b44e07ea6..dab3772d4 100644 --- a/spec/rubocop/cop/chef/modernize/sc_windows_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/sc_windows_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/seven_zip_archive_spec.rb b/spec/rubocop/cop/chef/modernize/seven_zip_archive_spec.rb index 1397ef72e..b98f71db9 100644 --- a/spec/rubocop/cop/chef/modernize/seven_zip_archive_spec.rb +++ b/spec/rubocop/cop/chef/modernize/seven_zip_archive_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/shell_out_helper_spec.rb b/spec/rubocop/cop/chef/modernize/shell_out_helper_spec.rb index f9374c0c1..f7bb9585a 100644 --- a/spec/rubocop/cop/chef/modernize/shell_out_helper_spec.rb +++ b/spec/rubocop/cop/chef/modernize/shell_out_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/shellout_to_chocolatey_spec.rb b/spec/rubocop/cop/chef/modernize/shellout_to_chocolatey_spec.rb index aee99fb5f..c605ba6d5 100644 --- a/spec/rubocop/cop/chef/modernize/shellout_to_chocolatey_spec.rb +++ b/spec/rubocop/cop/chef/modernize/shellout_to_chocolatey_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/simplify_apt_ppa_setup_spec.rb b/spec/rubocop/cop/chef/modernize/simplify_apt_ppa_setup_spec.rb index 47c49a109..5f559f704 100644 --- a/spec/rubocop/cop/chef/modernize/simplify_apt_ppa_setup_spec.rb +++ b/spec/rubocop/cop/chef/modernize/simplify_apt_ppa_setup_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/systctl_param_resource_spec.rb b/spec/rubocop/cop/chef/modernize/systctl_param_resource_spec.rb index 9c424904f..7a966f9cc 100644 --- a/spec/rubocop/cop/chef/modernize/systctl_param_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/systctl_param_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require_spec.rb b/spec/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require_spec.rb index a7028d570..167861405 100644 --- a/spec/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require_spec.rb +++ b/spec/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/use_multipackage_installs_spec.rb b/spec/rubocop/cop/chef/modernize/use_multipackage_installs_spec.rb index f855510ad..584fa2bb2 100644 --- a/spec/rubocop/cop/chef/modernize/use_multipackage_installs_spec.rb +++ b/spec/rubocop/cop/chef/modernize/use_multipackage_installs_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/use_require_relative_spec.rb b/spec/rubocop/cop/chef/modernize/use_require_relative_spec.rb index a17fd4e1b..1337d83b3 100644 --- a/spec/rubocop/cop/chef/modernize/use_require_relative_spec.rb +++ b/spec/rubocop/cop/chef/modernize/use_require_relative_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/whyrun_supported_true_spec.rb b/spec/rubocop/cop/chef/modernize/whyrun_supported_true_spec.rb index 4c7fc22ee..b5819a495 100644 --- a/spec/rubocop/cop/chef/modernize/whyrun_supported_true_spec.rb +++ b/spec/rubocop/cop/chef/modernize/whyrun_supported_true_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/windows_default_recipe_spec.rb b/spec/rubocop/cop/chef/modernize/windows_default_recipe_spec.rb index cf83ec110..74fe2c586 100644 --- a/spec/rubocop/cop/chef/modernize/windows_default_recipe_spec.rb +++ b/spec/rubocop/cop/chef/modernize/windows_default_recipe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/windows_registry_uac_spec.rb b/spec/rubocop/cop/chef/modernize/windows_registry_uac_spec.rb index 0199429bd..b280faa26 100644 --- a/spec/rubocop/cop/chef/modernize/windows_registry_uac_spec.rb +++ b/spec/rubocop/cop/chef/modernize/windows_registry_uac_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/windows_zipfile_spec.rb b/spec/rubocop/cop/chef/modernize/windows_zipfile_spec.rb index 653a62eb4..1363ff7db 100644 --- a/spec/rubocop/cop/chef/modernize/windows_zipfile_spec.rb +++ b/spec/rubocop/cop/chef/modernize/windows_zipfile_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/modernize/zipfile_resource_spec.rb b/spec/rubocop/cop/chef/modernize/zipfile_resource_spec.rb index da384b943..80fc1b6a9 100644 --- a/spec/rubocop/cop/chef/modernize/zipfile_resource_spec.rb +++ b/spec/rubocop/cop/chef/modernize/zipfile_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/modernize/zypper_repo_spec.rb b/spec/rubocop/cop/chef/modernize/zypper_repo_spec.rb index cafd7e54f..c9b07b7b4 100644 --- a/spec/rubocop/cop/chef/modernize/zypper_repo_spec.rb +++ b/spec/rubocop/cop/chef/modernize/zypper_repo_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/apt_repository_distribution_default_spec.rb b/spec/rubocop/cop/chef/redundant/apt_repository_distribution_default_spec.rb index b71d11730..47dae416c 100644 --- a/spec/rubocop/cop/chef/redundant/apt_repository_distribution_default_spec.rb +++ b/spec/rubocop/cop/chef/redundant/apt_repository_distribution_default_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update_spec.rb b/spec/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update_spec.rb index d112ca0b7..25182148d 100644 --- a/spec/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update_spec.rb +++ b/spec/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/attribute_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/attribute_metadata_spec.rb index 529ea01c0..df0e72ba7 100644 --- a/spec/rubocop/cop/chef/redundant/attribute_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/attribute_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/conflicts_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/conflicts_metadata_spec.rb index 814feab51..47a836343 100644 --- a/spec/rubocop/cop/chef/redundant/conflicts_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/conflicts_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions_spec.rb b/spec/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions_spec.rb index e220698a8..b1b1e3e98 100644 --- a/spec/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions_spec.rb +++ b/spec/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/grouping_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/grouping_metadata_spec.rb index 4221e2dfe..72717444f 100644 --- a/spec/rubocop/cop/chef/redundant/grouping_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/grouping_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/long_description_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/long_description_metadata_spec.rb index 0270f953a..5b0a5ccb3 100644 --- a/spec/rubocop/cop/chef/redundant/long_description_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/long_description_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/multiple_platform_checks_spec.rb b/spec/rubocop/cop/chef/redundant/multiple_platform_checks_spec.rb index 78e471051..17f781ba1 100644 --- a/spec/rubocop/cop/chef/redundant/multiple_platform_checks_spec.rb +++ b/spec/rubocop/cop/chef/redundant/multiple_platform_checks_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/name_property_and_required_spec.rb b/spec/rubocop/cop/chef/redundant/name_property_and_required_spec.rb index a78ad6c36..be3bd3e8d 100644 --- a/spec/rubocop/cop/chef/redundant/name_property_and_required_spec.rb +++ b/spec/rubocop/cop/chef/redundant/name_property_and_required_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/ohai_attribute_to_string_spec.rb b/spec/rubocop/cop/chef/redundant/ohai_attribute_to_string_spec.rb index 1dc0df197..122e0fef1 100644 --- a/spec/rubocop/cop/chef/redundant/ohai_attribute_to_string_spec.rb +++ b/spec/rubocop/cop/chef/redundant/ohai_attribute_to_string_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/property_splat_regex_spec.rb b/spec/rubocop/cop/chef/redundant/property_splat_regex_spec.rb index d2453d11e..ea89914e4 100644 --- a/spec/rubocop/cop/chef/redundant/property_splat_regex_spec.rb +++ b/spec/rubocop/cop/chef/redundant/property_splat_regex_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/property_with_default_and_required_spec.rb b/spec/rubocop/cop/chef/redundant/property_with_default_and_required_spec.rb index dc3adea84..4c242f8d3 100644 --- a/spec/rubocop/cop/chef/redundant/property_with_default_and_required_spec.rb +++ b/spec/rubocop/cop/chef/redundant/property_with_default_and_required_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/provides_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/provides_metadata_spec.rb index 080c3b833..15ff3296a 100644 --- a/spec/rubocop/cop/chef/redundant/provides_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/provides_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/recipe_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/recipe_metadata_spec.rb index cbec70e8e..0eb978d32 100644 --- a/spec/rubocop/cop/chef/redundant/recipe_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/recipe_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/replaces_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/replaces_metadata_spec.rb index aa1d74d71..5eb1b7dbf 100644 --- a/spec/rubocop/cop/chef/redundant/replaces_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/replaces_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/resource_with_nothing_action_spec.rb b/spec/rubocop/cop/chef/redundant/resource_with_nothing_action_spec.rb index f5d9d6fa8..329efa979 100644 --- a/spec/rubocop/cop/chef/redundant/resource_with_nothing_action_spec.rb +++ b/spec/rubocop/cop/chef/redundant/resource_with_nothing_action_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/sensitive_property_in_resource_spec.rb b/spec/rubocop/cop/chef/redundant/sensitive_property_in_resource_spec.rb index add3b1ce7..a1e0c068c 100644 --- a/spec/rubocop/cop/chef/redundant/sensitive_property_in_resource_spec.rb +++ b/spec/rubocop/cop/chef/redundant/sensitive_property_in_resource_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019-2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/string_property_with_nil_default_spec.rb b/spec/rubocop/cop/chef/redundant/string_property_with_nil_default_spec.rb index 2d8172f59..9793f8dc2 100644 --- a/spec/rubocop/cop/chef/redundant/string_property_with_nil_default_spec.rb +++ b/spec/rubocop/cop/chef/redundant/string_property_with_nil_default_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/suggests_metadata_spec.rb b/spec/rubocop/cop/chef/redundant/suggests_metadata_spec.rb index a32d0b6f4..5b1877360 100644 --- a/spec/rubocop/cop/chef/redundant/suggests_metadata_spec.rb +++ b/spec/rubocop/cop/chef/redundant/suggests_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/redundant/unnecessary_desired_state_spec.rb b/spec/rubocop/cop/chef/redundant/unnecessary_desired_state_spec.rb index 21ef814c0..ff5cf595f 100644 --- a/spec/rubocop/cop/chef/redundant/unnecessary_desired_state_spec.rb +++ b/spec/rubocop/cop/chef/redundant/unnecessary_desired_state_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/redundant/unnecessary_name_property_spec.rb b/spec/rubocop/cop/chef/redundant/unnecessary_name_property_spec.rb index 501d7f00c..407b2e6a2 100644 --- a/spec/rubocop/cop/chef/redundant/unnecessary_name_property_spec.rb +++ b/spec/rubocop/cop/chef/redundant/unnecessary_name_property_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Chris Henry # Copyright:: 2020, Chef Software, Inc. diff --git a/spec/rubocop/cop/chef/redundant/use_create_if_missing_spec.rb b/spec/rubocop/cop/chef/redundant/use_create_if_missing_spec.rb index 9944a5e47..a943c7aa2 100644 --- a/spec/rubocop/cop/chef/redundant/use_create_if_missing_spec.rb +++ b/spec/rubocop/cop/chef/redundant/use_create_if_missing_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/sharing/default_maintainer_metadata_spec.rb b/spec/rubocop/cop/chef/sharing/default_maintainer_metadata_spec.rb index 13e8b994d..fd6f4d719 100644 --- a/spec/rubocop/cop/chef/sharing/default_maintainer_metadata_spec.rb +++ b/spec/rubocop/cop/chef/sharing/default_maintainer_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/sharing/empty_metadata_field_spec.rb b/spec/rubocop/cop/chef/sharing/empty_metadata_field_spec.rb index 284ecece3..669f6d611 100644 --- a/spec/rubocop/cop/chef/sharing/empty_metadata_field_spec.rb +++ b/spec/rubocop/cop/chef/sharing/empty_metadata_field_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/sharing/include_property_descriptions_spec.rb b/spec/rubocop/cop/chef/sharing/include_property_descriptions_spec.rb index 0478466f8..7bf1d2636 100644 --- a/spec/rubocop/cop/chef/sharing/include_property_descriptions_spec.rb +++ b/spec/rubocop/cop/chef/sharing/include_property_descriptions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/sharing/include_resource_descriptions_spec.rb b/spec/rubocop/cop/chef/sharing/include_resource_descriptions_spec.rb index ff0ff0959..1af0b8c51 100644 --- a/spec/rubocop/cop/chef/sharing/include_resource_descriptions_spec.rb +++ b/spec/rubocop/cop/chef/sharing/include_resource_descriptions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/sharing/include_resource_examples_spec.rb b/spec/rubocop/cop/chef/sharing/include_resource_examples_spec.rb index 9b2461411..053d827fd 100644 --- a/spec/rubocop/cop/chef/sharing/include_resource_examples_spec.rb +++ b/spec/rubocop/cop/chef/sharing/include_resource_examples_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/sharing/insecure_cookbook_url_spec.rb b/spec/rubocop/cop/chef/sharing/insecure_cookbook_url_spec.rb index 87858ae05..1d2427bf3 100644 --- a/spec/rubocop/cop/chef/sharing/insecure_cookbook_url_spec.rb +++ b/spec/rubocop/cop/chef/sharing/insecure_cookbook_url_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/sharing/invalid_license_string_spec.rb b/spec/rubocop/cop/chef/sharing/invalid_license_string_spec.rb index d42d25291..b0578dfb8 100644 --- a/spec/rubocop/cop/chef/sharing/invalid_license_string_spec.rb +++ b/spec/rubocop/cop/chef/sharing/invalid_license_string_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/style/attribute_keys_spec.rb b/spec/rubocop/cop/chef/style/attribute_keys_spec.rb index d33feff84..28fbca09b 100644 --- a/spec/rubocop/cop/chef/style/attribute_keys_spec.rb +++ b/spec/rubocop/cop/chef/style/attribute_keys_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Noah Kantrowitz # diff --git a/spec/rubocop/cop/chef/style/file_mode_spec.rb b/spec/rubocop/cop/chef/style/file_mode_spec.rb index b54f17a5e..9f11d66f5 100644 --- a/spec/rubocop/cop/chef/style/file_mode_spec.rb +++ b/spec/rubocop/cop/chef/style/file_mode_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2016, Noah Kantrowitz # diff --git a/spec/rubocop/cop/chef/style/immediate_notification_timing_spec.rb b/spec/rubocop/cop/chef/style/immediate_notification_timing_spec.rb index c01483882..8e032b2f6 100644 --- a/spec/rubocop/cop/chef/style/immediate_notification_timing_spec.rb +++ b/spec/rubocop/cop/chef/style/immediate_notification_timing_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/style/include_recipe_with_parentheses_spec.rb b/spec/rubocop/cop/chef/style/include_recipe_with_parentheses_spec.rb index 4668803b5..9aeaf4b1f 100644 --- a/spec/rubocop/cop/chef/style/include_recipe_with_parentheses_spec.rb +++ b/spec/rubocop/cop/chef/style/include_recipe_with_parentheses_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/style/negating_only_if_spec.rb b/spec/rubocop/cop/chef/style/negating_only_if_spec.rb index cabd12a47..65127af8e 100644 --- a/spec/rubocop/cop/chef/style/negating_only_if_spec.rb +++ b/spec/rubocop/cop/chef/style/negating_only_if_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/style/overly_complex_supports_depends_metadata_spec.rb b/spec/rubocop/cop/chef/style/overly_complex_supports_depends_metadata_spec.rb index 190de62bf..0f2804cd9 100644 --- a/spec/rubocop/cop/chef/style/overly_complex_supports_depends_metadata_spec.rb +++ b/spec/rubocop/cop/chef/style/overly_complex_supports_depends_metadata_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2020, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/style/simplify_platform_major_version_check_spec.rb b/spec/rubocop/cop/chef/style/simplify_platform_major_version_check_spec.rb index 9593c229d..ddb340366 100644 --- a/spec/rubocop/cop/chef/style/simplify_platform_major_version_check_spec.rb +++ b/spec/rubocop/cop/chef/style/simplify_platform_major_version_check_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/cop/chef/style/true_false_resource_properties_spec.rb b/spec/rubocop/cop/chef/style/true_false_resource_properties_spec.rb index f1a054834..0ed4da131 100644 --- a/spec/rubocop/cop/chef/style/true_false_resource_properties_spec.rb +++ b/spec/rubocop/cop/chef/style/true_false_resource_properties_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/style/unnecessary_os_check_spec.rb b/spec/rubocop/cop/chef/style/unnecessary_os_check_spec.rb index 6974fb387..f6b1a6a10 100644 --- a/spec/rubocop/cop/chef/style/unnecessary_os_check_spec.rb +++ b/spec/rubocop/cop/chef/style/unnecessary_os_check_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/style/unnecessary_platform_case_statement_spec.rb b/spec/rubocop/cop/chef/style/unnecessary_platform_case_statement_spec.rb index 7274b4c7d..9575dcfb3 100644 --- a/spec/rubocop/cop/chef/style/unnecessary_platform_case_statement_spec.rb +++ b/spec/rubocop/cop/chef/style/unnecessary_platform_case_statement_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # Author:: Tim Smith () diff --git a/spec/rubocop/cop/chef/style/use_platform_helpers_spec.rb b/spec/rubocop/cop/chef/style/use_platform_helpers_spec.rb index ec7870337..edd4109b0 100644 --- a/spec/rubocop/cop/chef/style/use_platform_helpers_spec.rb +++ b/spec/rubocop/cop/chef/style/use_platform_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: 2019, Chef Software, Inc. # diff --git a/spec/rubocop/monkey_patches/cookstyle_comment_spec.rb b/spec/rubocop/monkey_patches/cookstyle_comment_spec.rb index 5cf4cfd30..e5913fffb 100644 --- a/spec/rubocop/monkey_patches/cookstyle_comment_spec.rb +++ b/spec/rubocop/monkey_patches/cookstyle_comment_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2019, Chef Software Inc. # diff --git a/spec/rubocop/monkey_patches/migration_departmentname_spec.rb b/spec/rubocop/monkey_patches/migration_departmentname_spec.rb index 89868b697..da2ea193a 100644 --- a/spec/rubocop/monkey_patches/migration_departmentname_spec.rb +++ b/spec/rubocop/monkey_patches/migration_departmentname_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # # Copyright:: Copyright 2020, Chef Software Inc. # diff --git a/spec/shared/autocorrect_behavior.rb b/spec/shared/autocorrect_behavior.rb index 5d1d9bb98..db021b27a 100755 --- a/spec/shared/autocorrect_behavior.rb +++ b/spec/shared/autocorrect_behavior.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.shared_examples 'autocorrect' do |original, corrected| it "autocorrects `#{original}` to `#{corrected}`" do autocorrected = autocorrect_source(original, 'spec/foo_spec.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c119245d0..a33b21f7b 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'rubocop' require 'rubocop/rspec/support' diff --git a/tasks/cops_documentation.rake b/tasks/cops_documentation.rake index caa41e98f..150ab68dc 100644 --- a/tasks/cops_documentation.rake +++ b/tasks/cops_documentation.rake @@ -1,3 +1,4 @@ +# frozen_string_literal: true begin require 'yard' require 'cookstyle'