diff --git a/config/disable_all.yml b/config/disable_all.yml index 8ef5a5913..48a860d77 100644 --- a/config/disable_all.yml +++ b/config/disable_all.yml @@ -169,6 +169,8 @@ Layout/SpaceAroundOperators: Enabled: false Layout/SpaceBeforeBlockBraces: Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false Layout/SpaceBeforeComma: Enabled: false Layout/SpaceBeforeComment: @@ -201,6 +203,8 @@ Layout/TrailingEmptyLines: Enabled: false Layout/TrailingWhitespace: Enabled: false +Lint/AmbiguousAssignment: + Enabled: false Lint/AmbiguousBlockAssociation: Enabled: false Lint/AmbiguousOperator: @@ -613,6 +617,8 @@ Style/HashAsLastArrayItem: Enabled: false Style/HashEachMethods: Enabled: false +Style/HashExcept: + Enabled: false Style/HashLikeCase: Enabled: false Style/HashSyntax: diff --git a/config/upstream.yml b/config/upstream.yml index ed2884e1a..f1f9c98bd 100644 --- a/config/upstream.yml +++ b/config/upstream.yml @@ -473,7 +473,7 @@ Layout/EmptyLineBetweenDefs: StyleGuide: '#empty-lines-between-methods' Enabled: true VersionAdded: '0.49' - VersionChanged: '1.4' + VersionChanged: '1.7' EmptyLineBetweenMethodDefs: true EmptyLineBetweenClassDefs: true EmptyLineBetweenModuleDefs: true @@ -1192,6 +1192,13 @@ Layout/SpaceBeforeBlockBraces: - no_space VersionChanged: '0.52' +Layout/SpaceBeforeBrackets: + Description: 'Checks for receiver with a space before the opening brackets.' + StyleGuide: '#space-in-brackets-access' + Enabled: pending + VersionAdded: '1.7' + Safe: false + Layout/SpaceBeforeComma: Description: 'No spaces before commas.' Enabled: true @@ -1354,6 +1361,11 @@ Layout/TrailingWhitespace: #################### Lint ################################## ### Warnings +Lint/AmbiguousAssignment: + Description: 'Checks for mistyped shorthand assignments.' + Enabled: pending + VersionAdded: '1.7' + Lint/AmbiguousBlockAssociation: Description: >- Checks for ambiguous block association with method when param passed without @@ -1396,6 +1408,7 @@ Lint/BinaryOperatorWithIdenticalOperands: Enabled: true Safe: false VersionAdded: '0.89' + VersionChanged: '1.7' Lint/BooleanSymbol: Description: 'Check for `:true` and `:false` symbols.' @@ -1472,6 +1485,9 @@ Lint/DuplicateBranch: Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs. Enabled: pending VersionAdded: '1.3' + VersionChanged: '1.7' + IgnoreLiteralBranches: false + IgnoreConstantBranches: false Lint/DuplicateCaseCondition: Description: 'Do not repeat values in case conditionals.' @@ -1842,6 +1858,8 @@ Lint/RedundantSplatExpansion: Description: 'Checks for splat unnecessarily being called on literals.' Enabled: true VersionAdded: '0.76' + VersionChanged: '1.7' + AllowPercentLiteralArrayArgument: true Lint/RedundantStringCoercion: Description: 'Checks for Object#to_s usage in string interpolation.' @@ -2045,6 +2063,11 @@ Lint/UnreachableLoop: Description: 'This cop checks for loops that will have at most one iteration.' Enabled: true VersionAdded: '0.89' + VersionChanged: '1.7' + IgnoredPatterns: + # RSpec uses `times` in its message expectations + # eg. `exactly(2).times` + - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/ Lint/UnusedBlockArgument: Description: 'Checks for unused block arguments.' @@ -2895,7 +2918,7 @@ Style/CollectionMethods: StyleGuide: '#map-find-select-reduce-include-size' Enabled: false VersionAdded: '0.9' - VersionChanged: '0.27' + VersionChanged: '1.7' Safe: false # Mapping from undesired method to desired method # e.g. to use `detect` over `find`: @@ -2910,6 +2933,11 @@ Style/CollectionMethods: detect: 'find' find_all: 'select' member?: 'include?' + # Methods in this array accept a final symbol as an implicit block + # eg. `inject(:+)` + MethodsAcceptingSymbol: + - inject + - reduce Style/ColonMethodCall: Description: 'Do not use :: for method call.' @@ -2969,6 +2997,7 @@ Style/CommentedKeyword: Description: 'Do not place comments on the same line as certain keywords.' Enabled: true VersionAdded: '0.51' + VersionChanged: '1.7' Style/ConditionalAssignment: Description: >- @@ -3328,6 +3357,13 @@ Style/HashEachMethods: VersionAdded: '0.80' Safe: false +Style/HashExcept: + Description: >- + Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods + that can be replaced with `Hash#except` method. + Enabled: pending + VersionAdded: '1.7' + Style/HashLikeCase: Description: >- Checks for places where `case-when` represents a simple 1:1 @@ -3482,6 +3518,7 @@ Style/KeywordParametersOrder: StyleGuide: '#keyword-parameters-order' Enabled: true VersionAdded: '0.90' + VersionChanged: '1.7' Style/Lambda: Description: 'Use the new lambda literal syntax for single-line blocks.' @@ -3520,7 +3557,7 @@ Style/MethodCallWithArgsParentheses: StyleGuide: '#method-invocation-parens' Enabled: false VersionAdded: '0.47' - VersionChanged: '0.61' + VersionChanged: '1.7' IgnoreMacros: true IgnoredMethods: [] IgnoredPatterns: [] @@ -3554,7 +3591,7 @@ Style/MethodDefParentheses: StyleGuide: '#method-parens' Enabled: true VersionAdded: '0.16' - VersionChanged: '0.35' + VersionChanged: '1.7' EnforcedStyle: require_parentheses SupportedStyles: - require_parentheses @@ -3660,6 +3697,7 @@ Style/MultilineMethodSignature: Description: 'Avoid multi-line method signatures.' Enabled: false VersionAdded: '0.59' + VersionChanged: '1.7' Style/MultilineTernaryOperator: Description: >- @@ -4026,12 +4064,16 @@ Style/RedundantArgument: Enabled: pending Safe: false VersionAdded: '1.4' - VersionChanged: '1.6' + VersionChanged: '1.7' Methods: # Array#join join: '' # String#split split: ' ' + # String#chomp + chomp: "\n" + # String#chomp! + chomp!: "\n" Style/RedundantAssignment: Description: 'Checks for redundant assignment before returning.' @@ -4288,7 +4330,7 @@ Style/SingleLineMethods: StyleGuide: '#no-single-line-methods' Enabled: true VersionAdded: '0.9' - VersionChanged: '0.19' + VersionChanged: '1.7' AllowIfMethodIsEmpty: true Style/SlicingWithRange: diff --git a/lib/cookstyle/version.rb b/lib/cookstyle/version.rb index 92ae4b8b1..24c58bfe9 100644 --- a/lib/cookstyle/version.rb +++ b/lib/cookstyle/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Cookstyle VERSION = "7.4.0" # rubocop: disable Style/StringLiterals - RUBOCOP_VERSION = '1.6.1' + RUBOCOP_VERSION = '1.7.0' end