You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
… by default
See rubocop#4658
This change has three changes.
- Disable auto-correction by default
- Improve the offense message
- Refactoring
Problem
=====
`Integer#times` does nothing if receiver is 0 or less.
However, `Array.new` raises an error if argument is less than 0.
For example:
```ruby
-1.times{} # does nothing
Array.new(-1) # ArgumentError: negative array size
```
Solution
=====
Disable the non-safe auto-correction by default. And Improve the offense message.
Expected behavior
To not break application by using auto correct.
Actual behavior
#<ArgumentError: negative array size>
Steps to reproduce the problem
rubocop -a
RuboCop version
The text was updated successfully, but these errors were encountered: