-
Notifications
You must be signed in to change notification settings - Fork 186
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
RedundantSyntax: distinguish single and triple quotes #1851
Conversation
Thanks for the report @bmarker, this was a "fun" fix to make! |
Oh, it's even "funnier" than I thought, it works in 2.13, but the compiler (or scalameta?) has a different output of string interpolation in 2.12 & 3 so we need a better heuristic than Also, it seems that scala/scala#8830 was not backported to 2.12, so we can't use the same test input across versions. |
917649c
to
4725a79
Compare
4725a79
to
a6f99e8
Compare
|
||
b = raw"foo $a \nbar" | ||
b = """foo\nbar\\""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes sure we still remove the interpolator when we can
b = s"""foo $a bar""" | ||
b = s"""$a""" | ||
|
||
b = "foo" | ||
b = f"foo $a%2.2f" | ||
b = "foo \n bar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes sure we still remove the interpolator when we can
@@ -8,18 +8,22 @@ class StringInterpolator { | |||
b = "foo" | |||
b = "foo" | |||
b = s"foo $a bar" | |||
b = "my \"quoted\" string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes sure we still remove the interpolator when we can
|
||
b = """foo""" | ||
b = | ||
"""foo | ||
|bar""" | ||
b = s"""my \"quoted\" string""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this tests the actual fix for the reported problem
cc @gontard as the original rule author for visibility |
👋 Thanks for the fix! |
🤯
Test input/output had to be duplicated because 2.12 does not support
s"my \"quoted\" string"