You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rubocop recognizes p wrapper method of the HTML paragraph tag as a stdout writer method p.
As, example:
div do
p { "Some text" }
p(){ "Some text" }
end
Replaces with:
div do
Rails.logger.debug { "Some text" }
Rails.logger.debug { "Some text" }
end
app/views/components/footer_partials/copyrights_section.rb:19:13: C: [Corrected] Rails/Output: Do not write to stdout. Use Rails's logger if you want to log.
Solution to Exclude Rails/Output cop as next at the .rubocop.yml:
Thanks for opening the issue with Rubocop. They seem to have some very aggressive rules by default. I’d be open to adding an alias for p such as para for folks that want to be able to use p for debugging.
@sbezugliy I’m going to close this for now. If rubocop-rails don't want to add a special case, I recommend getting around it by just adding alias_method :para, :p to your ApplicationView and then using para instead of p.
Rubocop recognizes
p
wrapper method of the HTML paragraph tag as a stdout writer method p.As, example:
Replaces with:
Solution to Exclude
Rails/Output
cop as next at the.rubocop.yml
:May redefinition of stdout method
p
with tag methodp
create some potential problems?Also I did open issue at the rubcop-rails (rubocop/rubocop-rails#1041)
The text was updated successfully, but these errors were encountered: