Wed 16 Feb 2005 09:11:31 AM UTC, comment #3:
I have a little awk script around that I use in my projects which verifies some basic rules on source code. Basically, it ensures there are no tabs used for indentation, than no trailing whitespace appears in lines, that lines are not longer than 80 columns, etc.
To automate things, I add a hook in the makefile, called 'lint' which calls awk with the above script over all the source files in the project. The result is a list of items that need to be fixed (and make exits with an error).
This 'lint' target can be added as a dependency to distcheck-hook so that published distfiles never suffer from this problem (in fact, this is to always remind you of existing formatting problems at certain important dates).
I think it may be good to add that script in monotone, if there is interest. We'd avoid the distcheck-hook change for now, because the script could trigger a lot of problems. But having the 'lint' target around may be nice.
Finally, we'd simply need to sweep through the code (some sed expressions should be enough) to convert tabs to spaces and to remove trailing whitespace. After that, we'd enable the distcheck hook. Unfortunately, the patches to do this will be (probably) giant, so I'm not sure it's really wanted...
|