Wednesday, February 25, 2009

Positive For a Change

I had intended when I first started this blog to include a bit more about the improvements we've been making in the development process at work to get things a bit more structured. The fact I have not is not indicative of any omissions on my part.

Now comes the positive bit. A couple of days ago I made a modification to the pre-commit hooks on the svn repository for the new project I'm on. Before my alterations, the script basically checked that the log message included a reference to an issue our issue tracking system (or at least something in the right format, actually checking for the issue's existence is on the todo list) and had some text in the message. Now, after a grand total of about half a day's effort I have modified the script to also load any modified java files and run checkstyle across them. Basically, it uses svnlook with the cat option to write the changed files out to disk, runs checkstyle across each file in turn, and then deletes the file, in a grand total of maybe half a dozen lines of python. It's currently using the strictest settings as laid down by the godhead of Sun, which are a little too strict for our purposes, but it's modified easily enough. The nice thing is that it's a fairly quick process that only adds a few seconds to the commit time.

The upshot of this is that a lot of the coding style guidelines that people are supposed to be following but which are ignored as soon as a deadline looms, are now enforced before the code is committed. Sure, there'll probably still be badly written javadoc, but at least there'll be javadoc written at all.

Next on my list: automating the creation of new version numbers inside Jira when creating a new svn branch. I don't think it will be quite as easy as the checkstyle.

No comments: