What software do you suggest to check spelling of comments contained in c/c++ source code (especially doxygen comments)? I'm looking something that will parse only comments so I can easily find mistakes and correct them.
The question is general but to be more specific - I'm using CodeLite IDE.
aspell command is used as a spell checker in Linux. Generally, it will scan the given files or anything from standard input then it check for misspellings. Finally it allows the user to correct the words interactively.
vim Spell checker Spell CheckingTo turn on the vim spell checker run :set spell . To turn it off run :set nospell . If you always want the spell checker to be on, add set spell to your vimrc. You can turn spelling on only for certain filetypes using an auto command.
Open up VS Code and hit F1 and type ext select install and type code-spell-checker hit enter and reload window to enable.
Emacs has ispell-comments-and-strings
which works pretty well from inside the editor. It relies on the syntax highlighting mechanism to identify comments and strings, so it works with any language for which you have good highlighting.
No idea if how you make it work with your IDE.
I needed something like this too. It needed to be able to run not only on Linux though.
I've seen that spell checking is often paired with an IDE (like with eclipse). I wanted a tool that was completely independent of any IDE however, because I wanted to be able to run it in automated/scripted contexts like Travis-CI builds or AppVeyor CI builds.
Looked around a little for such a tool and then decided to write my own.
What I came up with was pyspellcode which meets these needs. It's a python script that uses clang
and hunspell
which should readily run on Linux at least. The script:
hunspell
for checking, and thenWhat was an interesting surprise for me is how deeply clang parses C++ comments even into doxygen elements and embedded HTML markup. This made it possible to use clang's AST to do things like ignore words nested within <code>...</code>
blocks and I took advantage of that in the script.
The script's available from GitHub as a Zlib licensed open source project. It's just alpha software at the moment with at least one parsing bug in it but if there's interest in it, I'll give it more priority.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With