Closed
Description
When I created a list of paths separated by colon (like $PATH
envvar) including Rails.root
, the Rails/FilePath
cop warns to use Rails.root.join
. But it's not appropriate in this case.
Expected behavior
No warning is emitted.
Actual behavior
$ bundle exec rubocop --require rubocop-rails
Inspecting 2 files
.C
Offenses:
test.rb:3:8: C: Rails/FilePath: Prefer Rails.root.join('path/to').
PATH = "#{Rails.root}:/path/to/directory"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 files inspected, 1 offense detected
Steps to reproduce the problem
https://github.com/tk0miya/rubocop-rails-bugs is a minimal reproducible project.
RuboCop version
$ bundle exec rubocop --require rubocop-rails -Vbugs [master]
1.28.2 (using Parser 3.1.2.0, rubocop-ast 1.17.0, running on ruby 3.1.2 x86_64-darwin19)
- rubocop-rails 2.14.2
Metadata
Metadata
Assignees
Labels
No labels
Activity