Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask: What do you use for source code spell checker
2 points by probinso on April 3, 2014 | hide | past | favorite | 3 comments
I am interested in spell checking string literals and comments of a fair number of programs, spanning several programming languages.

Are there any tools that you have found work.

I happen to be using Linux, but would as well be interested in solutions for other operating systems.



https://github.com/yaur/SpellUnit Is something I wrote for C#.

It currently only has support for literals passed in to exception constructors (I common pattern in the code base I care about) and strings passed in to attributes that get bubbled up as API documentation. I'm working on more complex stack modeling stuff (using Mono.Cecil if your interested) to find literals passed into an arbitrary named function (e.g. log messages and functions that display in the UI) when I'm not busy with other stuff.

With somewhere between 500K and 1M LOC there is no practical way to spell check everything. There are just to many connection strings, regexs, format strings, etc to spell check every literal. If you add in comments you also need to worry about jargon that won't be in a standard dictionary. That is why I personally picked very narrow checking instead of the broad checking that is trivial available as an FXCOP rule.


I use RubyMine, which highlight spelling mistakes in string literals, variables, function names etc...


Emacs has `M-x ispell-comments-and-strings`, via ispell, which is all I've used in the past.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: