views:

417

answers:

2

What is a tool or technique that can be used to perform spell checks upon a whole source code base and its associated resource files?

The spell check should be source code aware meaning that it would stick to checking string literals in the code and not the code itself. Bonus points if the spell checker understands common resource file formats, for example text files containing name-value pairs (only check the values). Super-bonus points if you can tell it which parts of an XML DTD or Schema should be checked and which should be ignored.

Many IDEs can do this for the file you are currently working with. The difference in what I am looking for is something that can operate upon a whole source code base at once.

Something like a Findbugs or PMD type tool for mis-spellings would be ideal.

+1  A: 

As you mentioned, many IDEs have this functionality already, and one such IDE is Eclipse. However, unlike many other IDEs Eclipse is:

A) open source

B) designed to be programmable

For instance, here's an article on using Eclipse's code formatting functionality from the command line: http://www.peterfriese.de/formatting-your-code-using-the-eclipse-code-formatter/

In theory, you should be able to do something similar with it's spell-checking mechanism. I know this isn't exactly what you're looking for, and if there is a program for doing spell-checking in code then obviously that'd be better, but if not then Eclipse may be the next best thing.

machineghost
That's a very good suggestion, indeed.
shadit
A: 

Well, it's been a week, so I'm going to go ahead and close this. I really appreciate the good solution idea that was proposed. If I pursue this further, I'll update it here.

shadit
Any updates on this? I'd like to run this on a C++ codebase and haven't come across any particularly useful. It would be nice to have a lightweight app instead of having to run Eclipse just for spell checking.
Soo Wei Tan