does anyone share the need for such code style rules ?


the local coding conventions I found in my new team include :

1) space required before the "(" in method declarations and calls only
if the method has arguments, e.g.

callToMyMtehodWithArgs (arg1, arg2);

2) throws clause indented and multiple exceptions vertically aligned

class Foo
public MyType myMethod()
throws com.MyException1,

3) variable declarations aligned:

class Foo
private int myvar1 = 0;
protected MyType myType = null;

does anyone share the need to have these ?
does anyone know of how to write a plugin / external checker at least
for rule 1) which I can't have my fingers type ;) ?


1 comment
Comment actions Permalink

Incredible what people come up with in their coding guidelines...

I'm one of the developers of an open source tool to check coding conventions, Checkstyle comes with an Ant task and a commandline frontend.

Checkstyle 3.0 allows users to write their own checks as a plugin. Checks for the conventions you presented would probably be quite easy to implement, especially 1 should be very straightforward.

Please read the "writing checks" document and don't hesitate to ask on the checkstyle-user mailing list if you have any questions about the implementation of your check.

Hope this helps,


Please sign in to leave a comment.