Github user rxin commented on a diff in the pull request: https://github.com/apache/spark/pull/7712#discussion_r35615230 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeFormatter.scala --- @@ -35,11 +34,12 @@ private class CodeFormatter { private var indentString = "" private def addLine(line: String): Unit = { - val indentChange = line.count(_ == '{') - line.count(_ == '}') + val indentChange = + line.count(c => "({[".indexOf(c) >= 0) - line.count(c => ")}]".indexOf(c) >= 0) val newIndentLevel = math.max(0, indentLevel + indentChange) // Lines starting with '}' should be de-indented even if they contain '{' after; // in addition, lines ending with ':' are typically labels - val thisLineIndent = if (line.startsWith("}") || line.endsWith(":")) { + val thisLineIndent = if (line.startsWith("}") || line.startsWith(")") || line.endsWith(":")) { --- End diff -- I took square bracket out since it is not needed and makes the thing more verbose.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org