Replies: 2 comments
-
Using Google format is ok. The lack of linter in Java is a bit sad. I regularly use Scala, and Scala has a good formatter (scala-fmt), which can adjust the format without human labor. sqlite-jdbc is compiled with Java11 targeting java8, so using https://github.com/diffplug/spotless should be ok. |
Beta Was this translation helpful? Give feedback.
-
Spotless can be configured to run either during the If bound to If bound to I also use Kotlin which has opinionated style guide and a good formatter (ktlint). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As mentioned here we should probably have some kind of linter, code formatter, or rules to keep code clean.
In order to make sure it is applied consistently, I think it should be enforceable via CI tests, but also runnable locally to avoid the frustration of pushing code and seeing the tests are failing because of formatting.
I searched around and found https://stackoverflow.com/a/14692135/2041863
I quickly tested the different options, but most are showing potential bugs or detecting patterns more than enforcing code style.
Checkstyle can enforce checks, but I don't think it can apply checks, which is frustrating because you need to fix everything manually.
I also tried https://github.com/diffplug/spotless which can work with different formatters. I only tried Google format, but it requires Java 11.
@xerial please let me know if you have any preference, I'm happy to try different tools and check the results.
Beta Was this translation helpful? Give feedback.
All reactions