Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-3854

Scala style: require spaces before `{`

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • Project Infra
    • None

    Description

      We should require spaces before opening curly braces. This isn't in the style guide, but it probably should be:

      // Correct:
      if (true) {
        println("Wow!")
      }
      
      // Incorrect:
      if (true){
         println("Wow!")
      }
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dongjoon Dongjoon Hyun
            joshrosen Josh Rosen
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment