I have written a tool called "checkstyle" which does what you are looking for.
Checkstyle is a development tool to help programmers write Java code that
adheres to a coding standard. Its purpose is to automate the process of
checking Java code, and to spare humans of this boring (but important) task.
Release 1.1 of checkstyle is available at:
http://www.puppycrawl.com/checkstyle
The things that checkstyle checks for are:
- Unused or duplicate import statements.
- Javadoc comments are defined for class, interface, variable and method
declarations.
- Javadoc tags for a method match the actual code.
- The file starts with a specified header. This is useful to ensure that a
file has a copyright notice.
- An @author tag exists for class and interface Javadoc comments. Note: this
can be turned off.
- Format of variable names match specified regular expressions.
- Format of class and interface names match a specified regular expression.
- Format of parameter names match a specified regular expression.
- Variables that are not declared as private or protected.
- Correct use of white space around binary and unary operators.
- Ensure {}'s are used for if/while/for/do constructs.
- Lines are not longer than a specified length.
- Lines do not contain tabs. Note: this check can be turned off.
Checkstyle can be run via an ANT task or a command line utility. It is
available under the GNU General Public License.
Regards,
Oliver
http://www.puppycrawl.com
> -----Original Message-----
> From: Jérôme Lacoste [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 19 June 2001 12:14 AM
> To: Ant User
> Subject: Free Java coding convention checker with Ant task
>
>
> Anybody knows a tool to check Java coding convention that has an Ant Task?
>
> Jerome
>