I believe the usual Spark style convention is to use the extra braces and put it on a separate line, because that is more future-proof (e.g. if additional code is added within the body of the `if`).