Add hint when if or unless is followed by do
#244
+185
−1
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.
A typo in RSpec is typing
ifinstead ofit. Depending on the font, they can be hard to distinguish at a glance:This results in a confusing "Unmatched keyword, missing
end'?" error because bothifanddorequire their ownend. And some keywords likewhileandlooptakedo, so it's not always obvious thatiforunless` don't.The message needs to accommodate a scenario where it's unknown if the value inside accepts a block like:
This might be perfectly valid ruby code, so you wouldn't want to assert "if does not take a do" (since that's not the problem...the problem is that both if and do require an
endto close, but the code doesn't provide that.Before:
After:
Close #206