gdcc/xoai

format code consistently and programmatically (like gofmt or rustfmt)

Closed this issue · 0 comments

Over at https://groups.google.com/g/dataverse-dev/c/y2Jpk3szTf8/m/rckKmP6-BgAJ I explained that I was playing with Go and fell in love with the idea that all Go code is formatted the same way using a tool called gofmt. (Rust, which came along later, also has this with rustfmt).

Can we programmatically format the Java code in this repo?

I just stumbled upon https://github.com/google/google-java-format via https://github.com/eclipse-ee4j/cargotracker but I'm not picky about the tool.

Ideally the tool can be used by the command line as well as in an IDE.

We could even run all code through the tool as a pre or post commit hook in git or a GitHub Action.

Related: