diff --git a/config/disable_all.yml b/config/disable_all.yml index 26ca08a..01494aa 100644 --- a/config/disable_all.yml +++ b/config/disable_all.yml @@ -19,6 +19,8 @@ Gemspec/DuplicatedAssignment: Enabled: false Gemspec/OrderedDependencies: Enabled: false +Gemspec/RequireMFA: + Enabled: false Gemspec/RequiredRubyVersion: Enabled: false Gemspec/RubyVersionGlobalsUsage: @@ -459,6 +461,8 @@ Lint/UselessElseWithoutRescue: Enabled: false Lint/UselessMethodDefinition: Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false Lint/UselessSetterCall: Enabled: false Lint/UselessTimes: @@ -709,6 +713,8 @@ Style/MultilineInPatternThen: Enabled: false Style/NumberedParameters: Enabled: false +Style/OpenStructUse: + Enabled: false Style/RedundantAssignment: Enabled: false Style/RedundantFetchBlock: diff --git a/config/upstream.yml b/config/upstream.yml index 0828cb9..3931881 100644 --- a/config/upstream.yml +++ b/config/upstream.yml @@ -150,6 +150,7 @@ AllCops: rubocop-minitest: [minitest] rubocop-sequel: [sequel] rubocop-rake: [rake] + rubocop-graphql: [graphql] #################### Bundler ############################### @@ -258,6 +259,15 @@ Gemspec/OrderedDependencies: Include: - '**/*.gemspec' +Gemspec/RequireMFA: + Description: 'Checks that the gemspec has metadata to require MFA from RubyGems.' + Enabled: pending + VersionAdded: '1.23' + Reference: + - https://guides.rubygems.org/mfa-requirement-opt-in/ + Include: + - '**/*.gemspec' + Gemspec/RequiredRubyVersion: Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.' Enabled: true @@ -511,13 +521,13 @@ Layout/EmptyLineBetweenDefs: StyleGuide: '#empty-lines-between-methods' Enabled: true VersionAdded: '0.49' - VersionChanged: '1.7' + VersionChanged: '1.23' EmptyLineBetweenMethodDefs: true EmptyLineBetweenClassDefs: true EmptyLineBetweenModuleDefs: true - # If `true`, this parameter means that single line method definitions don't - # need an empty line between them. - AllowAdjacentOneLineDefs: false + # `AllowAdjacentOneLineDefs` means that single line method definitions don't + # need an empty line between them. `true` by default. + AllowAdjacentOneLineDefs: true # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2] NumberOfEmptyLines: 1 @@ -2308,6 +2318,11 @@ Lint/UselessMethodDefinition: Safe: false AllowComments: true +Lint/UselessRuby2Keywords: + Description: 'Finds unnecessary uses of `ruby2_keywords`.' + Enabled: pending + VersionAdded: '1.23' + Lint/UselessSetterCall: Description: 'Checks for useless setter call to a local variable.' Enabled: true @@ -2501,6 +2516,7 @@ Naming/FileName: StyleGuide: '#snake-case-files' Enabled: true VersionAdded: '0.50' + VersionChanged: '1.23' # Camel case file names listed in `AllCops:Include` and all file names listed # in `AllCops:Exclude` are excluded by default. Add extra excludes here. Exclude: [] @@ -2513,6 +2529,13 @@ Naming/FileName: # whether each source file's class or module name matches the file name -- # not whether the nested module hierarchy matches the subdirectory path. CheckDefinitionPathHierarchy: true + # paths that are considered root directories, for example "lib" in most ruby projects + # or "app/models" in rails projects + CheckDefinitionPathHierarchyRoots: + - lib + - spec + - test + - src # If non-`nil`, expect all source file names to match the following regex. # Only the file name itself is matched, not the entire file path. # Use anchors as necessary if you want to match the entire name rather than @@ -4216,6 +4239,16 @@ Style/OneLineConditional: VersionAdded: '0.9' VersionChanged: '0.90' +Style/OpenStructUse: + Description: >- + Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance, + version compatibility, and potential security issues. + Reference: + - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats + + Enabled: pending + VersionAdded: '1.23' + Style/OptionHash: Description: "Don't use option hashes when you can use keyword arguments." Enabled: false diff --git a/lib/chefstyle/version.rb b/lib/chefstyle/version.rb index aac35e5..96ea61b 100644 --- a/lib/chefstyle/version.rb +++ b/lib/chefstyle/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Chefstyle VERSION = "2.1.2" - RUBOCOP_VERSION = "1.22.3" + RUBOCOP_VERSION = "1.23.0" end