This page last changed on Jan 09, 2007 by aaime.
Adding automated code formatting to the maven build so that code formatting is always done.
Assigned to release:
Aproved, waiting on Jalopy bug(s)
Jody Garnett +1
Rob Atkinson +1
Alessio Fabiani +1
Andrea Aime +1
Gabriel Roldán +1
Other wiki discussions:
Differnt developers use different platforms and different development environemnts, which can lead to code being formatted in strange ways. Furthermore, every programmer has a differnt style. A consistent look and feel througout a codebase adds an heir of professionalism to a project. By adding an automated formatter to the maven build every time the code is compiled it will be formatted, and consistent for everyone.
Using the jalopy-maven-plugin in the geoserver build. Either to run the format task on every compiliation, or to make it developer policy to run the format task manualy before every commit.
From Andrea Aime
Here is my suggestion: plain old java formatting rules
Personally I'd like to see the code wrapped at 100 columns instead of 80, but that's just me.
Moreover, we must turn off jalopy javadoc comment formatter since it breaks as soon as the html is the comment is invalid with nasty error messages (aka, difficult to say what was wrong).
In parallel, I'd say we should dump an Eclipse code formatting template so that developers can format also without the build (I'm assuming the most of us are using Eclipse, feel free to dump settings for other ide too).
The initial pom setup can go as follows:
Setting up the formatter to run on a compile :
The jalopy geoserver convention attached to this page is a plain java coding convention with 100 colums wrapping and a custom Geoserver header.
The old jalopy geoserver convention attached to this page is the original Geoserver 1.3.0 convention, basically a modified plain java coding convention with 100 colums wrapping, Geoserver header and with
I think we're going to need someone to run jalopy on the full source tree, since some files have not been properly formatted, and if we just put it in the build then some developer changes will get mixed in with commits.
Also note we already have a jalopy file. It was in documents/jalopy.geoserver.xml on the 1.3.x source tree, not sure where it ended up in 1.4
Posted by cholmes at Aug 08, 2006 14:27