Skip to content

Commit

Permalink
Upgraded rubocop-performance to 1.8.0
Browse files Browse the repository at this point in the history
- Decided to disable `Performance/CollectionLiteralInLoop` because it wouldn't give a huge benefit and could potentially make code less legible.
- Decided to disable `Performance/Sum` for now because it is currently outputting an error message even if it's autofixed the issue.
  • Loading branch information
Jennifer Konikowski committed Sep 4, 2020
1 parent 817039d commit 067575f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* [`Lint/DuplicateRequire`](https://github.com/rubocop-hq/rubocop/pull/8474)
* [`Lint/TrailingCommaInAttributeDeclaration`](https://github.com/rubocop-hq/rubocop/pull/8549)
* Update [`Style/Alias` to prefer `alias_method`](https://github.com/testdouble/standard/pull/196)
* Update rubocop-performance from 1.7.1 to 1.8.0:
* Plan to enable [`Performance/Sum`](https://github.com/rubocop-hq/rubocop-performance/pull/137) in the future, but there is currently a bug in the implementation
* Add `ruby-2.3.yml` to add support for 2.3.

## 0.5.2

Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
standard (0.5.2)
rubocop (~> 0.90)
rubocop-performance (~> 1.7.1)
rubocop-performance (~> 1.8.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -35,8 +35,8 @@ GEM
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.3.0)
parser (>= 2.7.1.4)
rubocop-performance (1.7.1)
rubocop (>= 0.82.0)
rubocop-performance (1.8.0)
rubocop (>= 0.87.0)
ruby-progressbar (1.10.1)
simplecov (0.19.0)
docile (~> 1.1)
Expand Down
6 changes: 6 additions & 0 deletions config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ Performance/BindCall:
Performance/Caller:
Enabled: true

Performance/CollectionLiteralInLoop:
Enabled: false

Performance/CompareWithBlock:
Enabled: true

Expand Down Expand Up @@ -673,6 +676,9 @@ Performance/StartWith:
Performance/StringReplacement:
Enabled: true

Performance/Sum:
Enabled: false

Performance/UnfreezeString:
Enabled: true

Expand Down
5 changes: 1 addition & 4 deletions config/ruby-2.2.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
inherit_from: ./base.yml

AllCops:
TargetRubyVersion: 2.4 # The oldest supported
inherit_from: ./ruby-2.3.yml

Layout:
HeredocIndentation:
Expand Down
8 changes: 8 additions & 0 deletions config/ruby-2.3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_from: ./base.yml

AllCops:
TargetRubyVersion: 2.4 # The oldest supported

Performance:
Sum:
Enabled: false
2 changes: 2 additions & 0 deletions lib/standard/creates_config_store/assigns_rubocop_yaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def rubocop_yaml_path(desired_version)
"ruby-1.9.yml"
elsif desired_version < Gem::Version.new("2.3")
"ruby-2.2.yml"
elsif desired_version < Gem::Version.new("2.4")
"ruby-2.3.yml"
else
"base.yml"
end
Expand Down
2 changes: 1 addition & 1 deletion standard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "rubocop", "~> 0.90"
spec.add_dependency "rubocop-performance", "~> 1.7.1"
spec.add_dependency "rubocop-performance", "~> 1.8.0"

spec.add_development_dependency "bundler"
spec.add_development_dependency "minitest", "~> 5.0"
Expand Down

0 comments on commit 067575f

Please sign in to comment.