[
https://issues.apache.org/jira/browse/SPARK-3854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14166379#comment-14166379
]
Kousuke Saruta edited comment on SPARK-3854 at 10/10/14 4:37 AM:
-----------------------------------------------------------------
I think, we have some exception cases like as follows.
* import statement
{code}
import org.apache.spark.{SparkContext, ...}
{code}
* String interpolation
{code}
s"${someVariable}"
{code}
* xml interporation
{code}
<someElement someAttribute={someVariable}> ... </someElement>
{code}
or
{code}
<someElement>{someVariable}... </someElement>
{code}
So, we cannot make the rule to force to insert single space before all "{" .
was (Author: sarutak):
I think, we have some exception cases like as follows.
* import statement
import org.apache.spark.{SparkContext, ...}
* String interpolation
s"${someVariable}"
* Xml interporation
<someElement someAttribute={someVariable}> ... </someElement>
or
<someElement>{someVariable}... </someElement>
So, we cannot make the rule to force to insert single space before all "{" .
> Scala style: require spaces before `{`
> --------------------------------------
>
> Key: SPARK-3854
> URL: https://issues.apache.org/jira/browse/SPARK-3854
> Project: Spark
> Issue Type: Sub-task
> Components: Project Infra
> Reporter: Josh Rosen
>
> We should require spaces before opening curly braces. This isn't in the
> style guide, but it probably should be:
> {code}
> // Correct:
> if (true) {
> println("Wow!")
> }
> // Incorrect:
> if (true){
> println("Wow!")
> }
> {code}
> See https://github.com/apache/spark/pull/1658#discussion-diff-18611791 for an
> example "in the wild."
> {{git grep "){"}} shows only a few occurrences of this style.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]