-
-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Expected behavior
Currently, RuboCop suggest to correct expressions like
%w[a* b*].map { |e| Dir.glob(e) }.reduce(&:+)
to
%w[a* b*].map { |e| Dir.glob(e) }.sum
Since Dir.glob
is known to return an array we can autocorrect to sum([])
instead. This can be generalized to other stdlib methods returning arrays
Actual behavior
Unsafe autocorrection is %w[a* b*].map { |e| Dir.glob(e) }.sum
, which is invalid.
Steps to reproduce the problem
N/A
RuboCop version
main
Metadata
Metadata
Assignees
Labels
No labels