[comixed-dev] Code formatting for Java and Typescript

  • From: "Darryl L. Pierce" <mcpierce@xxxxxxxxx>
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Tue, 19 Nov 2019 22:01:30 -0500

To make things easier, I'd like to introduce some form of automated code
formatting for Java.

We already a configuration in the comixed-frontend submodule for use by
Prettier on Typescript code.

I'm looking currently at maven-git-code-format for use on the Java side of
the project. WIth it we can enforce the Google Java formatting standard on
the code. To format code we only need to do:

  $ mvn git-code-format:format-code

from the root and it formats the entire project. So that way we can all
work locally with whatever code convention we prefer. But when checking in
the code, we can run this plugin from the command line (or if you use
IntelliJ like I do you can just enable the google-java-format plugin) and
the code will be purely changes and not contain any reformatting-only lines.

What are everybody's thoughts on this?

-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie

Other related posts: