Reduce warnings "mismatched indentations" on ruby 2.6 #1222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
summary
In Ruby 2.6 with option "-w", introduce warning message "mismatched indentations" by following case-when syntax.
Fix to like this, warning message suppressed.
why
In some gem's test (that dependent to mail.gem) with "-w" option, output a ton of warning messages that makes test slow and hard to see the test results.
e.g. https://travis-ci.org/rails/rails/jobs/365674633
I know that this issue comes from auto generated ruby codes by ragel.
So "real fix" of this issue is making a patch to ragel (also I know!)
But...but, ragel is written in C. I couldn't fix the indentation issue.
Therefore, I add rufo gem as the development dependency and format in rake task to fix wrong (from ruby 2.6) case-when indents.
unsolved
Can't fix by using rufo in some case of warning messages.
statement not reached
assigned but unused variable