Hi developers, With the help of Zhenxu and Wenjun, we have successfully replaced the `Checkstyle` with `Spotless` in DolphinScheduler project [1] .
For your convenience, we suggest you copy the `pre-commit hook` file `/style/pre-commit` to your `.git/hooks/` directory so that every time you commit your code with `git commit`, `Spotless` will automatically fix things for you. In case you do not want to trigger the hook every time you run `git commit` and choose to fix all commits right before pushing, you may use `--no-verify` flag when running `git commit`. If you have any trouble using `Spotless`, please let us know by replying to this email thread. Thanks! [1] https://github.com/apache/dolphinscheduler/pull/11272 *Best Regards,* *Chufeng (Eric) Gao* Chufeng Gao <[email protected]> 于2022年7月15日周五 14:52写道: > Hi developers, > > Currently, DS uses `Checkstyle` plugin for style and formatting checks. > However, there are tons of legacy formatting errors in the project popping > out every time we build the project. Thus, in practice, some developers > tend to use `-Dcheckstyle.skip` flag when building the project and this > make the `style check` a little bit awkward. > > Huge advantage of using `Spotless`[1][2] over `CheckStyle` is in addition > to check the formatting of the code it also has `apply` goal that fixes all > the style and formatting automatically. With `Spotless`, we could fix the > legacy formatting errors once for all and developers could fix new format > errors with a single line of command `mvn spotless:apply`. > > If you have any suggestions, you are very welcome to comment in this mail > thread or in issue #10963 [3] > > [1] https://github.com/diffplug/spotless > [2] https://github.com/diffplug/spotless/tree/main/plugin-maven > [3] https://github.com/apache/dolphinscheduler/issues/10963 > > Thanks! > > Best Regards, > > Chufeng Gao > >
