Skip to content

Commit b369a45

Browse files
authored
Merge pull request #152 from chef/1.23
Update RuboCop to 1.23
2 parents 2f92bd6 + 3a1257b commit b369a45

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

config/disable_all.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Gemspec/DuplicatedAssignment:
1919
Enabled: false
2020
Gemspec/OrderedDependencies:
2121
Enabled: false
22+
Gemspec/RequireMFA:
23+
Enabled: false
2224
Gemspec/RequiredRubyVersion:
2325
Enabled: false
2426
Gemspec/RubyVersionGlobalsUsage:
@@ -459,6 +461,8 @@ Lint/UselessElseWithoutRescue:
459461
Enabled: false
460462
Lint/UselessMethodDefinition:
461463
Enabled: false
464+
Lint/UselessRuby2Keywords:
465+
Enabled: false
462466
Lint/UselessSetterCall:
463467
Enabled: false
464468
Lint/UselessTimes:
@@ -709,6 +713,8 @@ Style/MultilineInPatternThen:
709713
Enabled: false
710714
Style/NumberedParameters:
711715
Enabled: false
716+
Style/OpenStructUse:
717+
Enabled: false
712718
Style/RedundantAssignment:
713719
Enabled: false
714720
Style/RedundantFetchBlock:

config/upstream.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ AllCops:
150150
rubocop-minitest: [minitest]
151151
rubocop-sequel: [sequel]
152152
rubocop-rake: [rake]
153+
rubocop-graphql: [graphql]
153154

154155
#################### Bundler ###############################
155156

@@ -258,6 +259,15 @@ Gemspec/OrderedDependencies:
258259
Include:
259260
- '**/*.gemspec'
260261

262+
Gemspec/RequireMFA:
263+
Description: 'Checks that the gemspec has metadata to require MFA from RubyGems.'
264+
Enabled: pending
265+
VersionAdded: '1.23'
266+
Reference:
267+
- https://guides.rubygems.org/mfa-requirement-opt-in/
268+
Include:
269+
- '**/*.gemspec'
270+
261271
Gemspec/RequiredRubyVersion:
262272
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
263273
Enabled: true
@@ -511,13 +521,13 @@ Layout/EmptyLineBetweenDefs:
511521
StyleGuide: '#empty-lines-between-methods'
512522
Enabled: true
513523
VersionAdded: '0.49'
514-
VersionChanged: '1.7'
524+
VersionChanged: '1.23'
515525
EmptyLineBetweenMethodDefs: true
516526
EmptyLineBetweenClassDefs: true
517527
EmptyLineBetweenModuleDefs: true
518-
# If `true`, this parameter means that single line method definitions don't
519-
# need an empty line between them.
520-
AllowAdjacentOneLineDefs: false
528+
# `AllowAdjacentOneLineDefs` means that single line method definitions don't
529+
# need an empty line between them. `true` by default.
530+
AllowAdjacentOneLineDefs: true
521531
# Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
522532
NumberOfEmptyLines: 1
523533

@@ -2308,6 +2318,11 @@ Lint/UselessMethodDefinition:
23082318
Safe: false
23092319
AllowComments: true
23102320

2321+
Lint/UselessRuby2Keywords:
2322+
Description: 'Finds unnecessary uses of `ruby2_keywords`.'
2323+
Enabled: pending
2324+
VersionAdded: '1.23'
2325+
23112326
Lint/UselessSetterCall:
23122327
Description: 'Checks for useless setter call to a local variable.'
23132328
Enabled: true
@@ -2501,6 +2516,7 @@ Naming/FileName:
25012516
StyleGuide: '#snake-case-files'
25022517
Enabled: true
25032518
VersionAdded: '0.50'
2519+
VersionChanged: '1.23'
25042520
# Camel case file names listed in `AllCops:Include` and all file names listed
25052521
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
25062522
Exclude: []
@@ -2513,6 +2529,13 @@ Naming/FileName:
25132529
# whether each source file's class or module name matches the file name --
25142530
# not whether the nested module hierarchy matches the subdirectory path.
25152531
CheckDefinitionPathHierarchy: true
2532+
# paths that are considered root directories, for example "lib" in most ruby projects
2533+
# or "app/models" in rails projects
2534+
CheckDefinitionPathHierarchyRoots:
2535+
- lib
2536+
- spec
2537+
- test
2538+
- src
25162539
# If non-`nil`, expect all source file names to match the following regex.
25172540
# Only the file name itself is matched, not the entire file path.
25182541
# Use anchors as necessary if you want to match the entire name rather than
@@ -4216,6 +4239,16 @@ Style/OneLineConditional:
42164239
VersionAdded: '0.9'
42174240
VersionChanged: '0.90'
42184241

4242+
Style/OpenStructUse:
4243+
Description: >-
4244+
Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
4245+
version compatibility, and potential security issues.
4246+
Reference:
4247+
- https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats
4248+
4249+
Enabled: pending
4250+
VersionAdded: '1.23'
4251+
42194252
Style/OptionHash:
42204253
Description: "Don't use option hashes when you can use keyword arguments."
42214254
Enabled: false

lib/chefstyle/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22
module Chefstyle
33
VERSION = "2.1.2"
4-
RUBOCOP_VERSION = "1.22.3"
4+
RUBOCOP_VERSION = "1.23.0"
55
end

0 commit comments

Comments
 (0)