pulumi / pulumi-java

Java support for Pulumi
Apache License 2.0
69 stars 21 forks source link

Style checkers for the Java code #215

Open t0yv0 opened 2 years ago

t0yv0 commented 2 years ago

Hello!

Issue details

Enable style checkers for the Java code.

From @pawelprazak: I believe checkstyle is the de facto standard: https://checkstyle.sourceforge.io/#:~:text=Overview,to%20enforce%20a%20coding%20standard. https://docs.gradle.org/current/userguide/checkstyle_plugin.html

Affected area/feature

pawelprazak commented 2 years ago

It is tempting for me to just re-use Google's Java style guide. It is opinionated a bit, I personally don't mind. https://github.com/google/google-java-format https://plugins.gradle.org/plugin/com.github.sherter.google-java-format

The biggest upside for me would be not having to decide on what thousands of programmers spent uncountable hours arguing about. I love what Go did, fmt is in language toolchain.

This is a bit like google's go fmt.

pawelprazak commented 2 years ago

As for a linter, this one looks very good: https://github.com/tbroyer/gradle-errorprone-plugin https://github.com/google/error-prone

philipp-paland commented 2 years ago

Google Java Format is a good default if you don't want to think about how exactly you want the code to look like.