Rails/Output
cop recognises p
wraper method of the HTML paragraph tag(from phlex-rails
) as a stdout writer method p
and replaces it with Rails.logger.debug
#1041
Labels
bug
Something isn't working
I'm using phlex(https://github.com/phlex-ruby/phlex-rails) as HTML page renderer, as full replacement of the ActionView for Rails 7 view templates.
Expected behavior
Rails/Output cop should skip replacement of the
p
tag wrapper method with 'Rails.logger.debug' for templates ofphlex-rails
gem. As I suppose, for cases when it is not methods writing to the stdout, with predefined implementation class/module.Actual behavior
Rubocop-Rails recognises
p
method wrapping paragraph tag as an stdout writer methodp
, so replaces it withRails.logger.debug
:As, example
Replaces with:
Outup of the command
bundle exec rubocop -A
Solved it excluding
Rails/Output
cop as next at the.rubocop.yml
:Steps to reproduce the problem
phlex-rails
,rubocop
andrubocop-rails
gems to the Ruby on Rails project.rails g phlex:controller Hello index
.p { "Some text" }
to thetemplate
method of theindex
action of theHello
controller, expected file path is/app/views/hello/index_view.rb
.$ bundle exec rubocop -A
at the root of the project.RuboCop version
The text was updated successfully, but these errors were encountered: