diff --git a/CHANGELOG.md b/CHANGELOG.md index ebcea252..ce4c5b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## unreleased + +* Update Rubocop from + [0.90](https://github.com/rubocop-hq/rubocop/releases/tag/v0.90.0) + to + [0.91](https://github.com/rubocop-hq/rubocop/releases/tag/v0.91.0), + enabling: + * [`Lint/UselessTimes`](https://github.com/rubocop-hq/rubocop/pull/8702) + * [`Layout/BeginEndAlignment`](https://github.com/rubocop-hq/rubocop/pull/8628) + * [`Lint/ConstantDefinitionInBlock`](https://github.com/rubocop-hq/rubocop/pull/8707) + * [`Lint/IdentityComparison`](https://github.com/rubocop-hq/rubocop/pull/8699/) + re-enabling after bug fixes: + * [`Bundler/DuplicatedGem`](https://github.com/rubocop-hq/rubocop/pull/8666) + * [`Naming/BinaryOperatorParameterName`](https://github.com/rubocop-hq/rubocop/issues/8664) + ## 0.6.0 * Update Rubocop from diff --git a/Gemfile.lock b/Gemfile.lock index 75c4908f..bce6d041 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,16 +24,16 @@ GEM rake (13.0.1) regexp_parser (1.7.1) rexml (3.2.4) - rubocop (0.90.0) + rubocop (0.91.0) parallel (~> 1.10) parser (>= 2.7.1.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.7) rexml - rubocop-ast (>= 0.3.0, < 1.0) + rubocop-ast (>= 0.4.0, < 1.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.3.0) + rubocop-ast (0.4.0) parser (>= 2.7.1.4) rubocop-performance (1.8.0) rubocop (>= 0.87.0) diff --git a/config/base.yml b/config/base.yml index 42d1454c..ef03a214 100644 --- a/config/base.yml +++ b/config/base.yml @@ -7,6 +7,13 @@ AllCops: DisabledByDefault: true Exclude: [] +Bundler/DuplicatedGem: + Enabled: true + Include: + - '**/*.gemfile' + - '**/Gemfile' + - '**/gems.rb' + Bundler/InsecureProtocolSource: Enabled: true Include: @@ -32,16 +39,15 @@ Layout/ArrayAlignment: Enabled: true EnforcedStyle: with_fixed_indentation -Layout/HashAlignment: +Layout/AssignmentIndentation: Enabled: true - EnforcedHashRocketStyle: key - EnforcedColonStyle: key - EnforcedLastArgumentHashStyle: always_inspect + IndentationWidth: ~ -Layout/ParameterAlignment: +Layout/BeginEndAlignment: Enabled: true - EnforcedStyle: with_fixed_indentation - IndentationWidth: ~ + EnforcedStyleAlignWith: start_of_line + AutoCorrect: true + Severity: warning Layout/BlockAlignment: Enabled: true @@ -149,15 +155,17 @@ Layout/FirstArrayElementIndentation: EnforcedStyle: consistent IndentationWidth: ~ -Layout/AssignmentIndentation: - Enabled: true - IndentationWidth: ~ - Layout/FirstHashElementIndentation: Enabled: true EnforcedStyle: consistent IndentationWidth: ~ +Layout/HashAlignment: + Enabled: true + EnforcedHashRocketStyle: key + EnforcedColonStyle: key + EnforcedLastArgumentHashStyle: always_inspect + Layout/HeredocIndentation: Enabled: true @@ -208,6 +216,11 @@ Layout/MultilineOperationIndentation: EnforcedStyle: indented IndentationWidth: ~ +Layout/ParameterAlignment: + Enabled: true + EnforcedStyle: with_fixed_indentation + IndentationWidth: ~ + Layout/RescueEnsureAlignment: Enabled: true @@ -335,6 +348,9 @@ Lint/BooleanSymbol: Lint/CircularArgumentReference: Enabled: true +Lint/ConstantDefinitionInBlock: + Enabled: true + Lint/Debugger: Enabled: true @@ -400,6 +416,9 @@ Lint/FloatOutOfRange: Lint/FormatParameterMismatch: Enabled: true +Lint/IdentityComparison: + Enabled: true + Lint/ImplicitStringConcatenation: Enabled: true @@ -562,6 +581,9 @@ Lint/UselessElseWithoutRescue: Lint/UselessSetterCall: Enabled: true +Lint/UselessTimes: + Enabled: true + Lint/Void: Enabled: true CheckForMethodsWithNoSideEffects: false @@ -569,6 +591,9 @@ Lint/Void: Migration/DepartmentName: Enabled: true +Naming/BinaryOperatorParameterName: + Enabled: true + Naming/ClassAndModuleCamelCase: Enabled: true diff --git a/test/fixture/cli/autocorrectable-bad.rb b/test/fixture/cli/autocorrectable-bad.rb index 296360dc..4e0d3e3e 100644 --- a/test/fixture/cli/autocorrectable-bad.rb +++ b/test/fixture/cli/autocorrectable-bad.rb @@ -39,6 +39,12 @@ def do_stuff( a,b,c ) end } + test = 'hi' + test2 = 'hi' + test3 = test.object_id == test2.object_id + if test3 + 32 + 3 + end THINGS.keys.each { |key| if ( plus_stuff.reduce(:+) > 1 ) THINGS[key] = plus_stuff[i] @@ -46,6 +52,15 @@ def do_stuff( a,b,c ) } end + def do_even_more_stuff + foo = begin + do_stuff(1,2,3) + rescue StandardError + nil +end + foo + end + end diff --git a/test/fixture/cli/autocorrectable-good.rb b/test/fixture/cli/autocorrectable-good.rb index 989b6ce7..7f943ec4 100644 --- a/test/fixture/cli/autocorrectable-good.rb +++ b/test/fixture/cli/autocorrectable-good.rb @@ -35,12 +35,24 @@ def do_stuff(a, b, c) end end + test = "hi" + test2 = "hi" + test3 = test.equal?(test2) + if test3 + 32 + 3 + end THINGS.keys.each do |key| if plus_stuff.reduce(:+) > 1 THINGS[key] = plus_stuff[i] end end end + + def do_even_more_stuff + do_stuff(1, 2, 3) + rescue + nil + end end # some alignment opinions