Skip to content

Commit

Permalink
Merge pull request #147 from chef/1.22
Browse files Browse the repository at this point in the history
Update RuboCop to 1.22
  • Loading branch information
tas50 authored Sep 30, 2021
2 parents 641469e + dcf1ab4 commit f9f4ec6
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 14 deletions.
16 changes: 15 additions & 1 deletion config/disable_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ Lint/AmbiguousBlockAssociation:
Enabled: false
Lint/AmbiguousOperator:
Enabled: false
Lint/AmbiguousOperatorPrecedence:
Enabled: false
Lint/AmbiguousRange:
Enabled: false
Lint/AmbiguousRegexpLiteral:
Expand Down Expand Up @@ -307,10 +309,12 @@ Lint/IdentityComparison:
Enabled: false
Lint/ImplicitStringConcatenation:
Enabled: false
Lint/InheritException:
Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: false
Lint/IneffectiveAccessModifier:
Enabled: false
Lint/InheritException:
Enabled: false
Lint/InterpolationCheck:
Enabled: false
Lint/LambdaWithoutLiteralBlock:
Expand Down Expand Up @@ -383,6 +387,8 @@ Lint/RegexpAsCondition:
Enabled: false
Lint/RequireParentheses:
Enabled: false
Lint/RequireRelativeSelfPath:
Enabled: false
Lint/RescueException:
Enabled: false
Lint/RescueType:
Expand Down Expand Up @@ -701,6 +707,8 @@ Style/MethodCallWithArgsParentheses:
Enabled: false
Style/MultilineInPatternThen:
Enabled: false
Style/NumberedParameters:
Enabled: false
Style/RedundantAssignment:
Enabled: false
Style/RedundantFetchBlock:
Expand Down Expand Up @@ -773,6 +781,8 @@ Style/NonNilCheck:
Enabled: false
Style/Not:
Enabled: false
Style/NumberedParametersLimit:
Enabled: false
Style/NumericLiterals:
Enabled: false
Style/NumericLiteralPrefix:
Expand Down Expand Up @@ -853,6 +863,8 @@ Style/SafeNavigation:
Enabled: false
Style/Sample:
Enabled: false
Style/SelectByRegexp:
Enabled: false
Style/SelfAssignment:
Enabled: false
Style/Semicolon:
Expand Down Expand Up @@ -945,6 +957,8 @@ Style/ZeroLengthPredicate:
Enabled: false
Security/Eval:
Enabled: false
Security/IoMethods:
Enabled: false
Security/JSONLoad:
Enabled: false
Security/MarshalLoad:
Expand Down
74 changes: 62 additions & 12 deletions config/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ AllCops:
# What MRI version of the Ruby interpreter is the inspected code intended to
# run on? (If there is more than one, set this to the lowest version.)
# If a value is specified for TargetRubyVersion then it is used. Acceptable
# values are specificed as a float (i.e. 3.0); the teeny version of Ruby
# values are specified as a float (i.e. 3.0); the teeny version of Ruby
# should not be included. If the project specifies a Ruby version in the
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
# try to determine the desired version of Ruby by inspecting the
Expand Down Expand Up @@ -209,6 +209,7 @@ Bundler/InsecureProtocolSource:
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Enabled: true
VersionAdded: '0.50'
AllowHttpProtocol: true
Include:
- '**/*.gemfile'
- '**/Gemfile'
Expand Down Expand Up @@ -957,7 +958,6 @@ Layout/LineLength:
Enabled: true
VersionAdded: '0.25'
VersionChanged: '1.4'
AutoCorrect: true
Max: 120
# To make it possible to copy or click on URIs in the code, we allow lines
# containing a URI to be longer than Max.
Expand Down Expand Up @@ -1361,10 +1361,11 @@ Layout/SpaceInsideParens:
StyleGuide: '#spaces-braces'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.55'
VersionChanged: '1.22'
EnforcedStyle: no_space
SupportedStyles:
- space
- compact
- no_space

Layout/SpaceInsidePercentLiteralDelimiters:
Expand Down Expand Up @@ -1448,6 +1449,13 @@ Lint/AmbiguousOperator:
VersionAdded: '0.17'
VersionChanged: '0.83'

Lint/AmbiguousOperatorPrecedence:
Description: >-
Checks for expressions containing multiple binary operations with
ambiguous precedence.
Enabled: pending
VersionAdded: '1.21'

Lint/AmbiguousRange:
Description: Checks for ranges with ambiguous boundaries.
Enabled: pending
Expand Down Expand Up @@ -1485,9 +1493,9 @@ Lint/BinaryOperatorWithIdenticalOperands:
Lint/BooleanSymbol:
Description: 'Check for `:true` and `:false` symbols.'
Enabled: true
Safe: false
SafeAutoCorrect: false
VersionAdded: '0.50'
VersionChanged: '0.83'
VersionChanged: '1.22'

Lint/CircularArgumentReference:
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
Expand Down Expand Up @@ -1771,6 +1779,11 @@ Lint/ImplicitStringConcatenation:
Enabled: true
VersionAdded: '0.36'

Lint/IncompatibleIoSelectWithFiberScheduler:
Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
Enabled: pending
VersionAdded: '1.21'

Lint/IneffectiveAccessModifier:
Description: >-
Checks for attempts to use `private` or `protected` to set
Expand Down Expand Up @@ -2034,6 +2047,11 @@ Lint/RequireParentheses:
Enabled: true
VersionAdded: '0.18'

Lint/RequireRelativeSelfPath:
Description: 'Checks for uses a file requiring itself with `require_relative`.'
Enabled: pending
VersionAdded: '1.22'

Lint/RescueException:
Description: 'Avoid rescuing the Exception class.'
StyleGuide: '#no-blind-rescues'
Expand Down Expand Up @@ -2563,8 +2581,9 @@ Naming/HeredocDelimiterNaming:

Naming/InclusiveLanguage:
Description: 'Recommend the use of inclusive language instead of problematic terms.'
Enabled: pending
Enabled: false
VersionAdded: '1.18'
VersionChanged: '1.21'
CheckIdentifiers: true
CheckConstants: true
CheckVariables: true
Expand Down Expand Up @@ -2720,6 +2739,14 @@ Security/Eval:
Enabled: true
VersionAdded: '0.47'

Security/IoMethods:
Description: >-
Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
`IO.foreach`, and `IO.readlines`.
Enabled: pending
Safe: false
VersionAdded: '1.22'

Security/JSONLoad:
Description: >-
Prefer usage of `JSON.parse` over `JSON.load` due to potential
Expand Down Expand Up @@ -2796,8 +2823,9 @@ Style/AndOr:
Description: 'Use &&/|| instead of and/or.'
StyleGuide: '#no-and-or-or'
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.9'
VersionChanged: '0.25'
VersionChanged: '1.21'
# Whether `and` and `or` are banned only in conditionals (conditionals)
# or completely (always).
EnforcedStyle: conditionals
Expand Down Expand Up @@ -2831,9 +2859,9 @@ Style/ArrayJoin:
Style/AsciiComments:
Description: 'Use only ascii symbols in comments.'
StyleGuide: '#english-comments'
Enabled: true
Enabled: false
VersionAdded: '0.9'
VersionChanged: '0.52'
VersionChanged: '1.21'
AllowedChars:
- ©

Expand Down Expand Up @@ -2995,7 +3023,7 @@ Style/CaseEquality:
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.89'
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
# If `AllowOnConstant` option is enabled, the cop will ignore violations when the receiver of
# the case equality operator is a constant.
#
# # bad
Expand Down Expand Up @@ -3690,7 +3718,7 @@ Style/InPatternThen:
Style/InfiniteLoop:
Description: >-
Use Kernel#loop for infinite loops.
This cop is unsafe in the body may raise a `StopIteration` exception.
This cop is unsafe if the body may raise a `StopIteration` exception.
Safe: false
StyleGuide: '#infinite-loop'
Enabled: true
Expand Down Expand Up @@ -4116,6 +4144,21 @@ Style/Not:
VersionAdded: '0.9'
VersionChanged: '0.20'

Style/NumberedParameters:
Description: 'Restrict the usage of numbered parameters.'
Enabled: pending
VersionAdded: '1.22'
EnforcedStyle: allow_single_line
SupportedStyles:
- allow_single_line
- disallow

Style/NumberedParametersLimit:
Description: 'Avoid excessive numbered params in a single block.'
Enabled: pending
VersionAdded: '1.22'
Max: 1

Style/NumericLiteralPrefix:
Description: 'Use smallcase prefixes for numeric literals.'
StyleGuide: '#numeric-literal-prefixes'
Expand All @@ -4126,7 +4169,6 @@ Style/NumericLiteralPrefix:
- zero_with_o
- zero_only


Style/NumericLiterals:
Description: >-
Add underscores to large numeric literals to improve their
Expand Down Expand Up @@ -4447,6 +4489,8 @@ Style/RedundantSort:
`max_by` instead of `sort_by...last`, etc.
Enabled: true
VersionAdded: '0.76'
VersionChanged: '1.22'
Safe: false

Style/RedundantSortBy:
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
Expand Down Expand Up @@ -4527,6 +4571,12 @@ Style/Sample:
Enabled: true
VersionAdded: '0.30'

Style/SelectByRegexp:
Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
Enabled: pending
SafeAutoCorrect: false
VersionAdded: '1.22'

Style/SelfAssignment:
Description: >-
Checks for places where self-assignment shorthand should have
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.0.9"
RUBOCOP_VERSION = "1.20.0"
RUBOCOP_VERSION = "1.22.0"
end

0 comments on commit f9f4ec6

Please sign in to comment.