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
Back in 2017 #4517 raised the issue that trailing whitespaces should not be marked as offences in heredoc strings.
This resulted in #5777 which added a new config option to prevent the cop from complaining.
Whilst this seems like a good fix, it still means that when running auto correct, it will remove trailing spaces automatically, which could result in a change in logic.
This will print "authenticated" before running rubocop --auto-correct, but will fail after.
I've had a similar issue in production where we had to verify a signed string and to test I used an example provided string, which had trailing whitespace. Running rubocop --auto-correct broke the tests.
Expected behavior
Running rubocop --auto-correct should not remove the trailing whitespace.
Actual behavior
The whitespace is removed
Steps to reproduce the problem
See the script above
RuboCop version
0.81.0
The text was updated successfully, but these errors were encountered:
…Whitespace` to `true`
Fixesrubocop#7860.
This PR changes `AllowInHeredoc` option of `Layout/TrailingWhitespace`
to `true` by default. The default behavior will be more safe.
…ace` to `true`
Fixes#7860.
This PR changes `AllowInHeredoc` option of `Layout/TrailingWhitespace`
to `true` by default. The default behavior will be more safe.
Back in 2017 #4517 raised the issue that trailing whitespaces should not be marked as offences in heredoc strings.
This resulted in #5777 which added a new config option to prevent the cop from complaining.
Whilst this seems like a good fix, it still means that when running auto correct, it will remove trailing spaces automatically, which could result in a change in logic.
Take the below for example:
This will print "authenticated" before running
rubocop --auto-correct
, but will fail after.I've had a similar issue in production where we had to verify a signed string and to test I used an example provided string, which had trailing whitespace. Running
rubocop --auto-correct
broke the tests.Expected behavior
Running
rubocop --auto-correct
should not remove the trailing whitespace.Actual behavior
The whitespace is removed
Steps to reproduce the problem
See the script above
RuboCop version
0.81.0
The text was updated successfully, but these errors were encountered: