+1.

Since we have closed the checkstyle in CI in a long time, right now
there is a lot of files breaking our checkstyle rule, but we have
opened the checkstyle again, the code style will be fixed later.

The problem with using checkstyle is that our checkstyle doesn't cover
all code style, e.g. chained method call, method arguments alian... I
am not sure if it can be improved by adding new checkstyle rules.
In my knowledge, spotless can help to format the code in one command
and doesn't need to rely on ide setting, this can help to make our
code style really consistent.

But I think if we use spotless, we still need to increment fix the
code style, rather than fix it all in one PR.

Thanks,
Wenjun

On Fri, Jul 15, 2022 at 2:53 PM Chufeng Gao <[email protected]> wrote:
>
> 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

Reply via email to