Closed Tietew closed 3 months ago
Do you think the message
Rails.root is a Pathname so you can just use Rails.root.glob
would be better? Or do you have something else in mind?
We also were scratching our heads for a few minutes on this one, then figured it out. Not sure the clearest way to message the user though.
Also chiming in to say that I could not figure this one out until I found this issue. I think including a specific example with the suggested alternative to Dir[]
would go a long way.
@Earlopain Thanks for suggestion! Looks good tome.
RuboCop suggests confusing solution on following code:
Expected behavior
RuboCop suggests to rewrite
Dir[Rails.root.join(...)]
toRails.root.glob(...)
as autocorrection does.Actual behavior
RuboCop suggests to append
#[]
.But appending
#[]
is an incorrect solution.Note
Autocorrection works correctly. The issue is only in the message.
RuboCop version