-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix #11122] Add new Style/RedundantLineContinuation
cop
#11694
Conversation
This cop should be able to detect various redundat def foo \
end
class Foo \
end
foo do \
end and many cases. |
f0f0605
to
3bbc00f
Compare
@ydah I see a lot of CI failures. |
Style/RedundantLineContinuations
copStyle/RedundantLineContinuation
cop
1231ba4
to
7e8b251
Compare
Thank you so much for feedback. I updated this PR. |
32acd25
to
bdebfef
Compare
Thank you for lots. I updated this PR. |
Seems we're good to go here. Thanks! |
In looking at the release notes for v1.49, I noticed that the changelog entry on this was missing 👀 |
I also noticed that just now and opened the following PR. |
Here is an example of a false-positive case: merged_document.public_url.should eq \
"#{Settings.server.base_uri}/file_download?filename=graphql_receipts_merge%2Ftest1234" Gets autocorrect to: merged_document.public_url.should eq
"#{Settings.server.base_uri}/file_download?filename=graphql_receipts_merge%2Ftest1234" This is interpreted as merged_document.public_url.should eq()
"#{Settings.server.base_uri}/file_download?filename=graphql_receipts_merge%2Ftest1234" I have to put parentheses to preserve the correct behaviour now, but I actually preferred omitting them in that case. |
@gsamokovarov Thanks! I've opened #11752 to fix the false positive. |
I think there is a false positive: def ==(other)
foo == other.foo \
&& bar == other.bar \
&& baz == other.baz
end I get the following after autocorrect:
def ==(other)
foo == other.foo \
&& bar == other.bar
&& baz == other.baz
end |
This PR is a follow-up of rubocop#11694. Wrong method name was used in the cop.
… `&&` and `||` with a multiline condition. Follow up: rubocop#11694 (comment) This PR fixes a false positive for `Style/RedundantLineContinuation` when using `&&` and `||` with a multiline condition.
Follow up rubocop#11694 (comment) This PR fixes a false positive for `Style/RedundantLineContinuation` when using line concatenation and calling a method without parentheses.
Fix: #11122
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.