Ronny Brendel
Ronny Brendel

Reputation: 4845

Spell checker for comments, strings, maybe more

I am looking for a spell checker for c++ source code. Unfortunately all I can find is Visual Studio specific. I would like something which works on Linux.

Edit:

Ultimately I want to automate it in some way. I am not very proficient in spell checking, but what I am thinking of is a not-interactive console tool which prints error messages, or something like that.

Personally I use vim, but not everyone on the project does of course.

Currently we are using svn so it is possible to integrate it into the pre-commit-hook maybe? Don't you guys do something similar?

Upvotes: 6

Views: 3288

Answers (6)

Louis Langholtz
Louis Langholtz

Reputation: 3123

You can check out some alpha code I just whipped up for a similar purpose: pyspellcode. It's Zlib licensed and uses clang and hunspell.

No idea how pyspellcode compares to what KDE does/provides but am happy to receive comparisons and will prioritize its development more if there's interest it.

At just over 200 lines, I'm guessing pyspellcode is at least lighter weight than KDE's solution though KDE's solution I imagine is way more tested.

Upvotes: 0

Ronny Brendel
Ronny Brendel

Reputation: 4845

I found something!

svn co svn://anonsvn.kde.org/home/kde/trunk/quality/krazy2 krazy2

this is part of the quality management of KDE. Besides a multitude of checks (KDE-specific, qt-specific, cpp-specific, ...) there is automated spell checking.

hope this helps

Upvotes: 3

Chris Huang-Leaver
Chris Huang-Leaver

Reputation: 6089

Emacs too has spell checking, flyspell-prog-mode, is the one I use, it is a (very!) personal preference which one works best for you.

The automating the spell check idea is a much trickier one. The best you can hope for is one that will tell you if there are spelling errors. That's trickier than it sounds, especially with code comments which may have all sorts of valid abbreviations which are not real words.

Having a company policy that whatever people have their EDITOR environment variable set to has a spell check enabled, should cut down on the spelling errors in commit messages, for example.

Upvotes: 3

Kristof Provost
Kristof Provost

Reputation: 26332

Vim also supports spell checking.

See the other question for more.

Upvotes: 3

mcandre
mcandre

Reputation: 24642

Which editors do you use? Many of them have spell checking abilities. E.g., gedit just needs to have the spellcheck plugin enabled.

Upvotes: 2

smalltown2k
smalltown2k

Reputation: 810

Eclipse (Java based so will do mac, linux etc.) has spellcheckers built in. With the CDT plugin you can edit and build C++ code.

Upvotes: 3

Related Questions