-
Notifications
You must be signed in to change notification settings - Fork 5k
[Feature][style] Replace checkstyle plugin with spotless to automatically fix formatting errors #10963
Copy link
Copy link
Closed
Description
Search before asking
- I had searched in the issues and found no similar feature requirement.
Description
- Currently, DS CI checks formatting errors. However, it will be much more conveniently if we could find those style errors and automatically fix them before pushing the code.
- We could introduce
spotlessplugin into DS and use it to automatically fix the style. - https://github.com/diffplug/spotless
- https://github.com/diffplug/spotless/tree/main/plugin-maven
Use case
- At present, DS uses
checkstyleplugin. However, there are tons of legacy formatting errors in the project every time we build the project. Thus, in practice, some developers tend to use-Dcheckstyle.skipflag when building the project and this make thestyle checka little bit awkward. - Huge advantage of using
SpotlessoverCheckStyleis in addition to check the formatting of the code it also hasapplygoal that fixes all the style and formatting. WithSpotless, we could fix the legacy formatting errors once for all and developers could fix new format errors with a single line of commandmvn spotless:apply.
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable