From 81764ca453448a6b66a5c0f7bc6d57418eed4da2 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 23 Jan 2024 11:43:28 +0000 Subject: [PATCH] (CAT-1688) Upgrade rubocop Following a recent team decision, we are implementing a Rubocop Upgrade, moving the version from 1.48.1 to 1.50.0. This should be the final version until Puppet 7 is unsupported. --- .rubocop.yml | 3 +++ .rubocop_todo.yml | 34 +++++++--------------------------- Gemfile | 2 +- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 06ba896a..9878b063 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -18,6 +18,9 @@ AllCops: Style/ClassAndModuleChildren: Enabled: false +Layout/LineLength: + Max: 196 + #################################################### # Cops below here due for deprecation #################################################### diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 96b00c4e..886b2c95 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-04-12 14:55:26 UTC using RuboCop version 1.50.1. +# on 2024-01-23 11:29:18 UTC using RuboCop version 1.50.2. # 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 @@ -14,13 +14,6 @@ Gemspec/RequireMFA: Exclude: - 'ruby-pwsh.gemspec' -# Offense count: 1 -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec -Gemspec/RequiredRubyVersion: - Exclude: - - 'ruby-pwsh.gemspec' - # Offense count: 1 # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. Lint/DuplicateBranch: @@ -38,11 +31,11 @@ Lint/EmptyClass: Lint/IncompatibleIoSelectWithFiberScheduler: Exclude: - 'lib/pwsh.rb' -# + # Offense count: 17 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: - Max: 86 + Max: 83 # Offense count: 2 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. @@ -53,12 +46,12 @@ Metrics/BlockLength: # Offense count: 2 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 529 + Max: 526 # Offense count: 12 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: - Max: 25 + Max: 24 # Offense count: 22 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. @@ -68,7 +61,7 @@ Metrics/MethodLength: # Offense count: 10 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: - Max: 25 + Max: 24 # Offense count: 1 # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. @@ -97,7 +90,7 @@ RSpec/BeforeAfterAll: - 'spec/support/**/*.rb' - 'spec/acceptance/dsc/basic.rb' -# Offense count: 81 +# Offense count: 26 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: @@ -107,7 +100,6 @@ RSpec/ContextWording: - 'spec/acceptance/dsc/class.rb' - 'spec/acceptance/dsc/complex.rb' - 'spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb' - - 'spec/unit/pwsh/util_spec.rb' - 'spec/unit/pwsh/windows_powershell_spec.rb' - 'spec/unit/pwsh_spec.rb' @@ -176,11 +168,6 @@ RSpec/SubjectStub: Exclude: - 'spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb' -# Offense count: 6 -Style/ClassVars: - Exclude: - - 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb' - # Offense count: 1 # Configuration parameters: AllowedConstants. Style/Documentation: @@ -188,10 +175,3 @@ Style/Documentation: - 'spec/**/*' - 'test/**/*' - 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb' - -# Offense count: 121 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. -# URISchemes: http, https -Layout/LineLength: - Max: 196 diff --git a/Gemfile b/Gemfile index 16c07392..0e59f098 100644 --- a/Gemfile +++ b/Gemfile @@ -29,7 +29,7 @@ group :development do gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.48.1', require: false + gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "puppet-strings", '~> 4.0', require: false