Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

This seems little old but seems to do a good job Source Code Spell Checker

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top