Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No spell checking tool for C++ comments #65

Closed
louis-langholtz opened this issue Sep 2, 2017 · 3 comments
Closed

No spell checking tool for C++ comments #65

louis-langholtz opened this issue Sep 2, 2017 · 3 comments
Assignees
Labels
Enhancement For suggestions or changes that enhance any part of the project and isn't a bug.

Comments

@louis-langholtz
Copy link
Owner

Expected/Desired Behavior or Experience:

There should be no spelling mistakes in C++ comments especially since many of the comments are used in Doxygen documentation output. Need a command line tool for checking for spelling mistakes. This tool should be both manually and automatically runnable.

Actual Behavior:

There's currently no command line tool in place to check for spelling mistakes. Not manually nor automatically.

Steps to Reproduce the Actual Behavior:

Make a pull request with C++ code in it that has a comment with some words misspelled and notice that the misspellings don't get flagged by the PR mechanism.

@louis-langholtz louis-langholtz added the Enhancement For suggestions or changes that enhance any part of the project and isn't a bug. label Sep 2, 2017
@louis-langholtz
Copy link
Owner Author

louis-langholtz commented Sep 2, 2017

Something like using LLVM/Clang to emit the C++ comments and then run that output through a normal spell checker.

For example the following emits the AST for the Math.hpp file:

clang++ --std=c++14 -I. -Xclang -ast-dump -fsyntax-only PlayRho/Common/Math.hpp

Or to output the same but without the special characters add in the -fno-diagnostics-color option as in:

clang++ --std=c++14 -I. -fno-diagnostics-color -Xclang -ast-dump -fsyntax-only PlayRho/Common/Math.hpp

But it only seems to emit the Doxygen comments. So maybe there's something along the lines of using the LLVM library for this.

@louis-langholtz louis-langholtz changed the title Need command line runnable spell checking tool for C++ comments Want command line runnable spell checking tool for C++ comments Sep 3, 2017
@louis-langholtz louis-langholtz changed the title Want command line runnable spell checking tool for C++ comments No spell checking tool for C++ comments Sep 9, 2017
@louis-langholtz louis-langholtz self-assigned this Sep 10, 2017
@louis-langholtz
Copy link
Owner Author

Uploaded a new project I created for this: pyspellcode. It's a python script that parses the AST dump output from clang and runs words found in comment nodes through hunspell. It's not perfect by any means but it's completely IDE independent. It just needs clang and hunspell and a customized dictionary file for any extra words not already in hunspell's builtin dictionary.

I should be able to hook this up to this project's continuous integration at some point for automatically spell checking comments. Running it by hand for now though (to start with) and will be uploading a spell fix branch next.

@louis-langholtz louis-langholtz added this to the Beta Launch milestone Dec 24, 2017
@louis-langholtz
Copy link
Owner Author

Closing this since a tool for spell checking is available now.

Usage for this project is like:

 spell-check.py -I. -p Documentation/extra-words.dic -std=c++14 PlayRho/Dynamics/Body.hpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For suggestions or changes that enhance any part of the project and isn't a bug.
Projects
Development

No branches or pull requests

1 participant