apache / incubator-streampark

Make stream processing easier! Easy-to-use streaming application development framework and operation platform.
https://streampark.apache.org/
Apache License 2.0
3.91k stars 1.01k forks source link

[Feature] support format scala code with spotless-maven-plugin #2611

Closed zhoulii closed 1 year ago

zhoulii commented 1 year ago

Search before asking

Description

Streampark's inspection of scala code format is not strict, there are some inappropriate code format which are not detected. Besides, scala code format ofthen changes in pr which brings some unnecessary review work. Here we use the import order as an example (many scala classes in streampark have inappropriate import order):

Snipaste_2023-04-13_11-13-28

the left side is the import order of FlinkClientTrait.scala ,as we can see, the import package is decentralized. The right side is the reformated version, we put the imports from same project together, and make streampark's imports on the top.

streampark uses spotless-maven-plugin to format java code, this plugin also can support format scala code by rules, maybe we can integrate this feature into stremaprk project.

Usage Scenario

No response

Related issues

No response

Are you willing to submit a PR?

Code of Conduct

wolfboys commented 1 year ago

Great, we need this plugin

senlizishi commented 1 year ago

Agree. The existing scalastyle maven plugin in the Streamark project can only be used to detect scala formats and cannot be formatted.