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
classExampleendExample.module_eval(<<-CODE,__FILE__,__LINE__ + 1) def self.test p 'test'#{' '} endCODEExample.test
RuboCop version
$ rubocop -V
warning: parser/current is loading parser/ruby25, which recognizes
warning: 2.5.8-compliant syntax, but you are running 2.5.5.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
1.8.1 (using Parser 3.0.0.0, rubocop-ast 1.3.0, running on ruby 2.5.5 x86_64-linux)
The text was updated successfully, but these errors were encountered:
The idea is that this Cop is safe and (thus will auto-correct without introducing a bug).
There is no way for RuboCop to know if you intended the trailing whitespace in the heredoc or not; the cop assume you did, and the correction makes it possible to see it. You are of course welcome to modify it and remove it altogether.
It also makes it easier for people like me that have their editors set to automatically remove trailing whitespace 😆
Expected behavior
Expect trailing whitespaces to be removed.
Actual behavior
It is replaced with
#{' '}
Steps to reproduce the problem
Add example.rb:
example.rb
Run auto-correcting:
example.rb (auto-corrected)
RuboCop version
The text was updated successfully, but these errors were encountered: