diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index af4ff2514a..c228413167 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.80.0. +# using RuboCop version 1.86.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -138,7 +138,8 @@ Lint/UnusedMethodArgument: # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - - 'lib/puppet/type/schedule.rb' + - 'lib/puppet/pops/loader/loader_paths.rb' + - 'lib/puppet/util/multi_match.rb' # This cop supports unsafe autocorrection (--autocorrect-all). Performance/Count: @@ -149,6 +150,12 @@ Performance/Count: - 'lib/puppet/graph/relationship_graph.rb' - 'lib/puppet/provider.rb' +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: IncludeActiveSupportAliases. +Performance/DoubleStartEndWith: + Exclude: + - 'lib/puppet/ssl/certificate_request.rb' + # This cop supports unsafe autocorrection (--autocorrect-all). Performance/InefficientHashSearch: Exclude: @@ -311,10 +318,8 @@ Style/DoubleNegation: - 'lib/puppet/parser/functions/fqdn_rand.rb' - 'lib/puppet/pops/evaluator/evaluator_impl.rb' - 'lib/puppet/pops/issue_reporter.rb' - - 'lib/puppet/pops/types/p_runtime_type.rb' - 'lib/puppet/provider/package/apt.rb' - 'lib/puppet/type.rb' - - 'lib/puppet/util/feature.rb' # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowComments. @@ -538,7 +543,7 @@ Style/OptionalBooleanParameter: # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedMethods. -# AllowedMethods: nonzero? +# AllowedMethods: infinite?, nonzero? Style/RedundantCondition: Exclude: - 'lib/puppet/face/epp.rb' @@ -667,7 +672,7 @@ Style/TernaryParentheses: # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma +# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma Style/TrailingCommaInArguments: Exclude: - 'lib/puppet/util/windows/user.rb' @@ -725,12 +730,7 @@ Style/ZeroLengthPredicate: Enabled: false # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings. +# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings. # URISchemes: http, https Layout/LineLength: Max: 582 - -Performance/DoubleStartEndWith: - Exclude: - - 'lib/puppet/ssl/certificate_request.rb' - diff --git a/Gemfile b/Gemfile index 33e92f0b56..9e81907021 100644 --- a/Gemfile +++ b/Gemfile @@ -56,7 +56,7 @@ group(:test) do gem 'webrick', '~> 1.7', require: false gem 'yard', require: false - gem 'rubocop', '~> 1.81.6', require: false, platforms: [:ruby] + gem 'rubocop', '~> 1.86.1', require: false, platforms: [:ruby] gem 'rubocop-i18n', '~> 3.0', require: false, platforms: [:ruby] gem 'rubocop-performance', '~> 1.0', require: false, platforms: [:ruby] gem 'rubocop-rake', '~> 0.6', require: false, platforms: [:ruby] diff --git a/lib/puppet/pops/issues.rb b/lib/puppet/pops/issues.rb index e04315d245..4f5b0e0bc7 100644 --- a/lib/puppet/pops/issues.rb +++ b/lib/puppet/pops/issues.rb @@ -26,7 +26,7 @@ class Issue attr_writer :demotable # Configures the Issue with required arguments (bound by occurrence), and a block producing a message. - def initialize issue_code, *args, &block + def initialize(issue_code, *args, &block) @issue_code = issue_code @message_block = block @arg_names = args @@ -62,7 +62,7 @@ def format(hash = {}) # @api private # class MessageData - def initialize *argnames + def initialize(*argnames) singleton = class << self; self end argnames.each do |name| singleton.send(:define_method, name) do diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index 41d5f842b4..16090386b4 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -590,7 +590,7 @@ def self.extract_type_and_title(argtype, argtitle) argtype =~ /^([^\[\]]+)\[(.+)\]$/m then [::Regexp.last_match(1), ::Regexp.last_match(2)] elsif argtitle then [argtype, argtitle] elsif argtype.is_a?(Puppet::Type) then [argtype.class.name, argtype.title] - else raise ArgumentError, _("No title provided and %{type} is not a valid resource reference") % { type: argtype.inspect } # rubocop:disable Lint/ElseLayout + else raise ArgumentError, _("No title provided and %{type} is not a valid resource reference") % { type: argtype.inspect } end end private_class_method :extract_type_and_title