If, like me, you use checkstyle you may have wished from time to time that everyone on your development team used it too.
So, to satisfy that wish I wrote a script that plugs checkstyle into our version control system (CVS).
With this script you can ensure that code in violation of your coding standards never infects your system.
If you do decide to inflict such a thing on your team please do the decent thing and tell them what you are doing and ensure everyone knows what the guidelines are in advance. If everyone needs to put their import statements in alphabetical order (for example) then everyone should know this. It’s no fun having to fix a bunch of code just before check in, especially when you’re up against a deadline.
Other things about this script to note.
It’s probably a good idea to try it out on one project at first (it’s configured on a per project basis) and see how it goes from there.
To add the script to a project edit
commitinfo in your local
CVSROOT directory then commit that change to CVS.
Of course, before you do that you’ll need to install the script on your CVS server.
So, here is the script.