diff --git a/CHANGELOG.md b/CHANGELOG.md index 47cbb7ae..74a29c49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## unreleased + +* Update rubocop from 1.2.0 to [1.3.0](https://github.com/rubocop-hq/rubocop/releases/tag/v1.3.0) enabling: + * [`Style/NilLambda`](https://github.com/rubocop-hq/rubocop/pull/9020) + * [`Lint/DuplicateBranch`](https://github.com/rubocop-hq/rubocop/pull/8404) + ## 0.9.0 * Update rubocop from 1.0.0 to [1.2.0](https://github.com/rubocop-hq/rubocop/releases/tag/v1.2.0) enabling: diff --git a/Gemfile.lock b/Gemfile.lock index 98121b80..67d717a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: standard (0.9.0) - rubocop (= 1.2.0) + rubocop (= 1.3.0) rubocop-performance (= 1.8.1) GEM @@ -14,7 +14,7 @@ GEM gimme (0.5.0) method_source (1.0.0) minitest (5.14.2) - parallel (1.19.2) + parallel (1.20.0) parser (2.7.2.0) ast (~> 2.4.1) pry (0.13.1) @@ -24,13 +24,13 @@ GEM rake (13.0.1) regexp_parser (1.8.2) rexml (3.2.4) - rubocop (1.2.0) + rubocop (1.3.0) parallel (~> 1.10) parser (>= 2.7.1.5) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8) rexml - rubocop-ast (>= 1.0.1) + rubocop-ast (>= 1.1.1) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) rubocop-ast (1.1.1) diff --git a/config/base.yml b/config/base.yml index 0c44b174..b10df827 100644 --- a/config/base.yml +++ b/config/base.yml @@ -360,6 +360,9 @@ Lint/DeprecatedClassMethods: Lint/DeprecatedOpenSSLConstant: Enabled: true +Lint/DuplicateBranch: + Enabled: true + Lint/DuplicateCaseCondition: Enabled: true @@ -893,7 +896,6 @@ Style/IfWithSemicolon: Style/InfiniteLoop: Enabled: true - SafeAutoCorrect: true Style/KeywordParametersOrder: Enabled: true @@ -971,6 +973,9 @@ Style/NilComparison: Enabled: true EnforcedStyle: predicate +Style/NilLambda: + Enabled: true + Style/NonNilCheck: Enabled: true IncludeSemanticChanges: false diff --git a/lib/standard/cop/semantic_blocks.rb b/lib/standard/cop/semantic_blocks.rb index 427cefe5..4efe47df 100644 --- a/lib/standard/cop/semantic_blocks.rb +++ b/lib/standard/cop/semantic_blocks.rb @@ -28,9 +28,7 @@ def on_block(node) def autocorrect(node) return if correction_would_break_code?(node) - if node.single_line? - replace_do_end_with_braces(node.loc) - elsif node.braces? + if node.braces? replace_braces_with_do_end(node.loc) else replace_do_end_with_braces(node.loc) diff --git a/standard.gemspec b/standard.gemspec index 9bb4cc92..12b929d8 100644 --- a/standard.gemspec +++ b/standard.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "rubocop", "1.2.0" + spec.add_dependency "rubocop", "1.3.0" spec.add_dependency "rubocop-performance", "1.8.1" spec.add_development_dependency "bundler"