-
Notifications
You must be signed in to change notification settings - Fork 278
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
#690: Support check for "redundant enclosing brace" in string interpo... #703
Changes from 1 commit
02a2e8f
6dbb87a
563c76d
0575418
8d16d4a
cc87132
a75c69c
723f4a3
0c8173f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,35 +194,35 @@ object a { | |
} | ||
<<< no braces in str interpolation | ||
object c { | ||
s"$a" | ||
s"${a}" | ||
} | ||
>>> | ||
object c { | ||
s"$a" | ||
} | ||
<<< two args no braces in str interpolation | ||
<<< two args in str interpolation | ||
object c { | ||
s"$a$b" | ||
s"${a}${b}" | ||
} | ||
>>> | ||
object c { | ||
s"$a$b" | ||
} | ||
<<< spaces before and after arg no braces in str interpolation | ||
<<< spaces before and after arg in str interpolation | ||
object c { | ||
s" $a " | ||
s" ${a} " | ||
} | ||
>>> | ||
object c { | ||
s" $a " | ||
s" ${a} " | ||
} | ||
<<< special symbol after arg no braces in str interpolation | ||
object c { | ||
s"$a-" | ||
s"${a}-" | ||
} | ||
>>> | ||
object c { | ||
s"$a-" | ||
s"${a}-" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, a can be unwrapped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this one fails There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i was generally thinking about checks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can look at the spec https://www.scala-lang.org/files/archive/spec/2.11/01-lexical-syntax.html#identifiers Seems like this rewrite should not take place when the right hand part starts with underscore or an alphanumeric character. In other cases, you can safely remove the curly brace. |
||
} | ||
<<< number after arg in str interpolation | ||
object c { | ||
|
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.
Is this expected output?
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.
it's a bug)