### _Why are the changes needed?_ #1383 As IntelliJ IDEA's `Optimize Imports` result does not meet rules in `scalastyle-config.xml`, currently developers have to arrange package imports manually. In this PR, we introduce a `.scalafmt.conf` file to solve the problem. It works as follows: 1. Set scala code style formatter to `scalafmt`. 2. Execute `Reformat Code` 3. IDEA picks up configurations in `.scalafmt.conf` and format both code lines and imports. We also formatted all historical scala codes. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1391 from zhouyifan279/1383. Closes #1383 e0696a9e [zhouyifan279] [KYUUBI #1383] Leverage Scalafmt to auto format scala code 18b8e229 [zhouyifan279] [KYUUBI #1383] Leverage Scalafmt to auto format scala code Authored-by: zhouyifan279 <zhouyifan279@gmail.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
29 lines
715 B
Plaintext
29 lines
715 B
Plaintext
version = 3.1.1
|
|
runner.dialect=scala212
|
|
project.git=true
|
|
|
|
align.preset = none
|
|
align.openParenDefnSite = false
|
|
align.openParenCallSite = false
|
|
align.stripMargin = true
|
|
align.tokens = []
|
|
assumeStandardLibraryStripMargin = true
|
|
danglingParentheses.preset = false
|
|
docstrings.style = Asterisk
|
|
docstrings.wrap = no
|
|
importSelectors = singleLine
|
|
indent.extendSite = 2
|
|
literals.hexDigits = Upper
|
|
maxColumn = 100
|
|
newlines.source = keep
|
|
newlines.topLevelStatementBlankLines = []
|
|
optIn.configStyleArguments = false
|
|
rewrite.imports.groups = [
|
|
["javax?\\..*"],
|
|
["scala\\..*"],
|
|
["(?!org\\.apache\\.kyuubi\\.).*"],
|
|
["org\\.apache\\.kyuubi\\..*"]
|
|
]
|
|
rewrite.imports.sort = scalastyle
|
|
rewrite.rules = [Imports, SortModifiers]
|