Skip to content

Commit

Permalink
Merge pull request #89 from chef/0.85
Browse files Browse the repository at this point in the history
Update RuboCop engine from 0.83 to 0.85
  • Loading branch information
tas50 authored Jun 1, 2020
2 parents d8b485c + 31d70ba commit 9a2e280
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 19 deletions.
4 changes: 4 additions & 0 deletions config/chefstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,3 +628,7 @@ Style/Alias:
# anyone else's time either.
Style/CommentedKeyword:
Enabled: false

# make sure we catch this Ruby 3.0 breaking change now
Lint/DeprecatedOpenSSLConstant:
Enabled: true
8 changes: 8 additions & 0 deletions config/disable_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ Lint/Debugger:
Enabled: false
Lint/DeprecatedClassMethods:
Enabled: false
Lint/DeprecatedOpenSSLConstant:
Enabled: false
Lint/DisjunctiveAssignmentInConstructor:
Enabled: false
Lint/DuplicateCaseCondition:
Expand Down Expand Up @@ -263,6 +265,8 @@ Lint/Loop:
Enabled: false
Lint/MissingCopEnableDirective:
Enabled: false
Lint/MixedRegexpCaptureTypes:
Enabled: false
Lint/MultipleComparison:
Enabled: false
Lint/NestedMethodDefinition:
Expand Down Expand Up @@ -667,6 +671,10 @@ Style/RedundantParentheses:
Enabled: false
Style/RedundantPercentQ:
Enabled: false
Style/RedundantRegexpCharacterClass:
Enabled: false
Style/RedundantRegexpEscape:
Enabled: false
Style/RedundantReturn:
Enabled: false
Style/RedundantSelf:
Expand Down
71 changes: 53 additions & 18 deletions config/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,13 @@ Bundler/GemComment:
Description: 'Add a comment describing each gem.'
Enabled: false
VersionAdded: '0.59'
VersionChanged: '0.77'
VersionChanged: '0.85'
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
IgnoredGems: []
OnlyFor: []

Bundler/InsecureProtocolSource:
Description: >-
Expand Down Expand Up @@ -468,6 +469,13 @@ Layout/EmptyLinesAroundAttributeAccessor:
StyleGuide: '#empty-lines-around-attribute-accessor'
Enabled: pending
VersionAdded: '0.83'
VersionChanged: '0.84'
AllowAliasSyntax: true
AllowedMethods:
- alias_method
- public
- protected
- private

Layout/EmptyLinesAroundBeginBody:
Description: "Keeps track of empty lines around begin-end bodies."
Expand Down Expand Up @@ -783,13 +791,7 @@ Layout/HeredocIndentation:
StyleGuide: '#squiggly-heredocs'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.77'
EnforcedStyle: squiggly
SupportedStyles:
- squiggly
- active_support
- powerpack
- unindent
VersionChanged: '0.85'

Layout/IndentationConsistency:
Description: 'Keep indentation straight.'
Expand Down Expand Up @@ -857,13 +859,13 @@ Layout/LeadingEmptyLines:
VersionChanged: '0.77'

Layout/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: '#80-character-limits'
Description: 'Checks that line length does not exceed the configured limit.'
StyleGuide: '#max-line-length'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.78'
VersionChanged: '0.84'
AutoCorrect: false
Max: 80
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.
AllowHeredoc: true
Expand Down Expand Up @@ -1370,6 +1372,11 @@ Lint/DeprecatedClassMethods:
Enabled: true
VersionAdded: '0.19'

Lint/DeprecatedOpenSSLConstant:
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
Enabled: pending
VersionAdded: '0.84'

Lint/DisjunctiveAssignmentInConstructor:
Description: 'In constructor, plain assignment is preferred over disjunctive.'
Enabled: true
Expand Down Expand Up @@ -1526,6 +1533,11 @@ Lint/MissingCopEnableDirective:
# .inf for any size
MaximumRangeSize: .inf

Lint/MixedRegexpCaptureTypes:
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
Enabled: pending
VersionAdded: '0.85'

Lint/MultipleComparison:
Description: "Use `&&` operator to compare multiple values."
Enabled: true
Expand Down Expand Up @@ -1999,6 +2011,11 @@ Naming/ClassAndModuleCamelCase:
StyleGuide: '#camelcase-classes'
Enabled: true
VersionAdded: '0.50'
VersionChanged: '0.85'
# Allowed class/module names can be specified here.
# These can be full or part of the name.
AllowedNames:
- module_parent

Naming/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
Expand All @@ -2019,6 +2036,10 @@ Naming/FileName:
# It further expects it to be nested inside modules which match the names
# of subdirectories in its path.
ExpectMatchingDefinition: false
# When `false`, changes the behavior of ExpectMatchingDefinition to match only
# 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
# 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 @@ -2210,7 +2231,7 @@ Security/JSONLoad:
Description: >-
Prefer usage of `JSON.parse` over `JSON.load` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
Enabled: true
VersionAdded: '0.43'
VersionChanged: '0.44'
Expand All @@ -2223,7 +2244,7 @@ Security/MarshalLoad:
Description: >-
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
Enabled: true
VersionAdded: '0.47'

Expand All @@ -2237,7 +2258,7 @@ Security/YAMLLoad:
Description: >-
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
Enabled: true
VersionAdded: '0.47'
SafeAutoCorrect: false
Expand Down Expand Up @@ -2274,7 +2295,7 @@ Style/AndOr:
VersionChanged: '0.25'
# Whether `and` and `or` are banned only in conditionals (conditionals)
# or completely (always).
EnforcedStyle: always
EnforcedStyle: conditionals
SupportedStyles:
- always
- conditionals
Expand Down Expand Up @@ -2694,6 +2715,11 @@ Style/DoubleNegation:
StyleGuide: '#no-bang-bang'
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.84'
EnforcedStyle: allowed_in_returns
SupportedStyles:
- allowed_in_returns
- forbidden

Style/EachForSimpleLoop:
Description: >-
Expand Down Expand Up @@ -2857,8 +2883,7 @@ Style/FrozenStringLiteralComment:
SupportedStyles:
# `always` will always add the frozen string literal comment to a file
# regardless of the Ruby version or if `freeze` or `<<` are called on a
# string literal. If you run code against multiple versions of Ruby, it is
# possible that this will create errors in Ruby 2.3.0+.
# string literal. It is possible that this will create errors.
- always
# `always_true` will add the frozen string literal comment to a file,
# similarly to the `always` style, but will also change any disabled
Expand Down Expand Up @@ -3593,6 +3618,16 @@ Style/RedundantPercentQ:
Enabled: true
VersionAdded: '0.76'

Style/RedundantRegexpCharacterClass:
Description: 'Checks for unnecessary single-element Regexp character classes.'
Enabled: pending
VersionAdded: '0.85'

Style/RedundantRegexpEscape:
Description: 'Checks for redundant escapes in Regexps.'
Enabled: pending
VersionAdded: '0.85'

Style/RedundantReturn:
Description: "Don't use return where it's not required."
StyleGuide: '#no-explicit-return'
Expand Down
2 changes: 1 addition & 1 deletion lib/chefstyle/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Chefstyle
VERSION = "1.0.5".freeze
RUBOCOP_VERSION = "0.83.0".freeze
RUBOCOP_VERSION = "0.85.0".freeze
end

0 comments on commit 9a2e280

Please sign in to comment.