Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rubocop dependency version to 0.50.0 #35

Merged
merged 7 commits into from
Oct 11, 2017
Merged

Conversation

onk
Copy link
Owner

@onk onk commented Oct 11, 2017

  • Update rubocop v0.50.0 and rubocop-rspec v1.18.0
  • Disable Performance/HashEachMethods cop
  • Disable new Style/OrAssignment cop
  • Change cop's department from Style to Naming
  • Disable new Lint/RescueWithoutErrorClass cop
  • node_modules directory is now excluded by rubocop as default
  • Enable Style/YodaCondition cop with equality_operators_only style

The new configuration option since v0.50.0 is reasonable.

rubocop pull/4514
It is common sense that just `rescue` means `rescue StandardError`.

rubocop issues/2943, pull/4564
Sometimes conditional expressions may be more important.
The same reason as Style/IfUnlessModifier.

rubocop pull/4648
```ruby
require "benchmark/ips"
Benchmark.ips do |x|
  hash = [*"a".."z"].zip([*1..26]).to_h
  x.report("each_key")  { hash.each_key { |k| k.upcase } }
  x.report("keys.each") { hash.keys.each { |k| k.upcase } }
  x.report("each")      { hash.each { |k, _| k.upcase } }
end
```

```
Warming up --------------------------------------
            each_key    22.511k i/100ms
           keys.each    21.115k i/100ms
                each    20.680k i/100ms
Calculating -------------------------------------
            each_key    244.031k (± 9.5%) i/s -      1.216M in   5.031621s
           keys.each    236.148k (±10.5%) i/s -      1.182M in   5.069345s
                each    242.460k (± 8.9%) i/s -      1.220M in   5.077224s
```

`keys.each` is a bit slow but `each` and `each_key` are same-ish.

rubocop 2a2b03f806
(Prior to this commit, this cop only checked the variable named `hash`.
@onk onk merged commit a94a819 into master Oct 11, 2017
@onk onk deleted the bump_rubocop_v0_50_0 branch October 11, 2017 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant