On master branch (6c3ea4753bbb9f1ffb0f2ee60400fd0b432ede3f) I’m seeing Rails/FilePath complain about this code:
<<-FOO
1
/
FOO
test.rb:1:1: C: Rails/FilePath: Please use Rails.root.join('path', 'to') instead.
<<-FOO
^^^^^^
With git bisect I found that the false positive was introduced in 707c9a85c1d99bfee8a10ac404abf6a14d6a88f0 – cc @koic
No offense should be found.
An offense found for Rails/FilePath.
See above.
$ rubocop -V
0.52.1 (using Parser 2.5.0.2, running on ruby 2.4.2 x86_64-darwin15)
$ git rev-parse @
6c3ea4753bbb9f1ffb0f2ee60400fd0b432ede3f
Thanks for the feedback.
I reproduced this false positive. I will investigate.
I just found another false positive which may be related.
'' \
'/'
test.rb:1:1: C: Rails/FilePath: Please use Rails.root.join('path', 'to') instead.
'' \
^^^
One more:
"#{42}/"
test.rb:1:1: C: Rails/FilePath: Please use Rails.root.join('path', 'to') instead.
"#{42}/"
^^^^^^^^