From e3910e374845f281859b525816b3b2a37d0d5d07 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 9 Jul 2020 12:39:15 -0700 Subject: [PATCH] Update to RuboCop 0.87.1 Signed-off-by: Tim Smith --- config/disable_all.yml | 6 +++++ config/upstream.yml | 50 ++++++++++++++++++++++++++++++++++++---- lib/chefstyle/version.rb | 2 +- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/config/disable_all.yml b/config/disable_all.yml index 538bed3..0fce1e6 100644 --- a/config/disable_all.yml +++ b/config/disable_all.yml @@ -421,6 +421,8 @@ Naming/VariableNumber: Enabled: false Style/AccessModifierDeclarations: Enabled: false +Style/AccessorGrouping: + Enabled: false Style/Alias: Enabled: false Style/AndOr: @@ -437,6 +439,8 @@ Style/BarePercentLiterals: Enabled: false Style/BeginBlock: Enabled: false +Style/BisectedAttrAccessor: + Enabled: false Style/BlockComments: Enabled: false Style/BlockDelimiters: @@ -567,6 +571,8 @@ Style/MethodCallWithoutArgsParentheses: Enabled: false Style/MethodCallWithArgsParentheses: Enabled: false +Style/RedundantAssignment: + Enabled: false Style/RedundantFetchBlock: Enabled: false Style/MethodCalledOnDoEndBlock: diff --git a/config/upstream.yml b/config/upstream.yml index dbb537f..c08228f 100644 --- a/config/upstream.yml +++ b/config/upstream.yml @@ -180,6 +180,9 @@ Bundler/OrderedGems: VersionAdded: '0.46' VersionChanged: '0.47' TreatCommentsAsGroupSeparators: true + # By default, "-" and "_" are ignored for order purposes. + # This can be overridden by setting this parameter to true. + ConsiderPunctuation: false Include: - '**/*.gemfile' - '**/Gemfile' @@ -200,6 +203,9 @@ Gemspec/OrderedDependencies: Enabled: true VersionAdded: '0.51' TreatCommentsAsGroupSeparators: true + # By default, "-" and "_" are ignored for order purposes. + # This can be overridden by setting this parameter to true. + ConsiderPunctuation: false Include: - '**/*.gemspec' @@ -1508,7 +1514,9 @@ Lint/InheritException: Lint/InterpolationCheck: Description: 'Raise warning for interpolation in single q strs.' Enabled: true + SafeAutoCorrect: false VersionAdded: '0.50' + VersionChanged: '0.87' Lint/LiteralAsCondition: Description: 'Checks of literals used in conditions.' @@ -1736,6 +1744,7 @@ Lint/SafeNavigationWithEmpty: Description: 'Avoid `foo&.empty?` in conditionals.' Enabled: true VersionAdded: '0.62' + VersionChanged: '0.87' Lint/ScriptPermission: Description: 'Grant script file execute permission.' @@ -1902,9 +1911,10 @@ Metrics/BlockLength: Description: 'Avoid long blocks with many lines.' Enabled: true VersionAdded: '0.44' - VersionChanged: '0.66' + VersionChanged: '0.87' CountComments: false # count full line comments? Max: 25 + CountAsOne: [] ExcludedMethods: # By default, exclude the `#refine` method, as it tends to have larger # associated blocks. @@ -1925,8 +1935,10 @@ Metrics/ClassLength: Description: 'Avoid classes longer than 100 lines of code.' Enabled: true VersionAdded: '0.25' + VersionChanged: '0.87' CountComments: false # count full line comments? Max: 100 + CountAsOne: [] # Avoid complex methods. Metrics/CyclomaticComplexity: @@ -1944,17 +1956,20 @@ Metrics/MethodLength: StyleGuide: '#short-methods' Enabled: true VersionAdded: '0.25' - VersionChanged: '0.59.2' + VersionChanged: '0.87' CountComments: false # count full line comments? Max: 10 + CountAsOne: [] ExcludedMethods: [] Metrics/ModuleLength: Description: 'Avoid modules longer than 100 lines of code.' Enabled: true VersionAdded: '0.31' + VersionChanged: '0.87' CountComments: false # count full line comments? Max: 100 + CountAsOne: [] Metrics/ParameterLists: Description: 'Avoid parameter lists longer than three or four parameters.' @@ -1992,10 +2007,12 @@ Naming/AccessorMethodName: VersionAdded: '0.50' Naming/AsciiIdentifiers: - Description: 'Use only ascii symbols in identifiers.' + Description: 'Use only ascii symbols in identifiers and constants.' StyleGuide: '#english-identifiers' Enabled: true VersionAdded: '0.50' + VersionChanged: '0.87' + AsciiConstants: true Naming/BinaryOperatorParameterName: Description: 'When defining binary operators, name the argument other.' @@ -2288,6 +2305,17 @@ Style/AccessModifierDeclarations: - group AllowModifiersOnSymbols: true +Style/AccessorGrouping: + Description: 'Checks for grouping of accessors in `class` and `module` bodies.' + Enabled: 'pending' + VersionAdded: '0.87' + EnforcedStyle: grouped + SupportedStyles: + # separated: each accessor goes in a separate statement. + # grouped: accessors are grouped into a single statement. + - separated + - grouped + Style/Alias: Description: 'Use alias instead of alias_method.' StyleGuide: '#alias-method-lexically' @@ -2355,6 +2383,13 @@ Style/BeginBlock: Enabled: true VersionAdded: '0.9' +Style/BisectedAttrAccessor: + Description: >- + Checks for places where `attr_reader` and `attr_writer` + for the same method can be combined into single `attr_accessor`. + Enabled: 'pending' + VersionAdded: '0.87' + Style/BlockComments: Description: 'Do not use block comments.' StyleGuide: '#no-block-comments' @@ -2729,6 +2764,7 @@ Style/DoubleNegation: VersionAdded: '0.19' VersionChanged: '0.84' EnforcedStyle: allowed_in_returns + SafeAutoCorrect: false SupportedStyles: - allowed_in_returns - forbidden @@ -2995,6 +3031,7 @@ Style/IfUnlessModifierOfIfUnless: Avoid modifier if/unless usage on conditionals. Enabled: true VersionAdded: '0.39' + VersionChanged: '0.87' Style/IfWithSemicolon: Description: 'Do not use if x; .... Use the ternary operator instead.' @@ -3581,6 +3618,11 @@ Style/RandomWithOffset: Enabled: true VersionAdded: '0.52' +Style/RedundantAssignment: + Description: 'Checks for redundant assignment before returning.' + Enabled: 'pending' + VersionAdded: '0.87' + Style/RedundantBegin: Description: "Don't use begin blocks when they are not needed." StyleGuide: '#begin-implicit' @@ -3924,7 +3966,7 @@ Style/SymbolLiteral: Style/SymbolProc: Description: 'Use symbols as procs instead of blocks when possible.' Enabled: true - SafeAutoCorrect: false + Safe: false VersionAdded: '0.26' VersionChanged: '0.64' # A list of method names to be ignored by the check. diff --git a/lib/chefstyle/version.rb b/lib/chefstyle/version.rb index 180ba44..f9b689e 100644 --- a/lib/chefstyle/version.rb +++ b/lib/chefstyle/version.rb @@ -1,4 +1,4 @@ module Chefstyle VERSION = "1.1.2".freeze - RUBOCOP_VERSION = "0.86.0".freeze + RUBOCOP_VERSION = "0.87.1".freeze end