Skip to content

Commit

Permalink
Merge pull request #152 from chef/1.23
Browse files Browse the repository at this point in the history
Update RuboCop to 1.23
  • Loading branch information
tas50 authored Nov 15, 2021
2 parents 2f92bd6 + 3a1257b commit b369a45
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
6 changes: 6 additions & 0 deletions config/disable_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Gemspec/DuplicatedAssignment:
Enabled: false
Gemspec/OrderedDependencies:
Enabled: false
Gemspec/RequireMFA:
Enabled: false
Gemspec/RequiredRubyVersion:
Enabled: false
Gemspec/RubyVersionGlobalsUsage:
Expand Down Expand Up @@ -459,6 +461,8 @@ Lint/UselessElseWithoutRescue:
Enabled: false
Lint/UselessMethodDefinition:
Enabled: false
Lint/UselessRuby2Keywords:
Enabled: false
Lint/UselessSetterCall:
Enabled: false
Lint/UselessTimes:
Expand Down Expand Up @@ -709,6 +713,8 @@ Style/MultilineInPatternThen:
Enabled: false
Style/NumberedParameters:
Enabled: false
Style/OpenStructUse:
Enabled: false
Style/RedundantAssignment:
Enabled: false
Style/RedundantFetchBlock:
Expand Down
41 changes: 37 additions & 4 deletions config/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ AllCops:
rubocop-minitest: [minitest]
rubocop-sequel: [sequel]
rubocop-rake: [rake]
rubocop-graphql: [graphql]

#################### Bundler ###############################

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: []
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/chefstyle/version.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b369a45

Please sign in to comment.