You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Martin Grund (Jira)" <ji...@apache.org> on 2022/10/14 07:11:00 UTC
[jira] [Created] (SPARK-40797) Force grouped import onto single line with Scalafmt
Martin Grund created SPARK-40797:
------------------------------------
Summary: Force grouped import onto single line with Scalafmt
Key: SPARK-40797
URL: https://issues.apache.org/jira/browse/SPARK-40797
Project: Spark
Issue Type: Improvement
Components: Build
Affects Versions: 3.4.0
Reporter: Martin Grund
When using the scalafmt.conf file as provided by the project repository to organize and optimize imports there is a case in which un-desired behavior appears.
If the import group does not fit on a single line, Scalafmt will by default try to bin-pack and then break out over mulitple lines.
For example:
import org.apache.spark.sql.catalyst.analysis.\{UnresolvedAlias, UnresolvedAttribute, UnresolvedFunction, UnresolvedRelation, UnresolvedStar}{{{}{}}}will become
import org.apache.spark.sql.catalyst.analysis.\{
UnresolvedAlias,
UnresolvedAttributed,
...
}{{{}{}}}In previous code reviews this has been marked as departing from the consistency of the Spark code base even when using the provided scalafmt.conf.
Scalafmt allows to configure this by setting an option
{code:java}
importSelectors = "singleLine"{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org