https://github.com/louis-langholtz/pyspellcode
Python script for using clang's AST dump and hunsepll for spell checking source code comments.
https://github.com/louis-langholtz/pyspellcode
c-plus-plus command-line-tool spell-checker utility
Last synced: 5 months ago
JSON representation
Python script for using clang's AST dump and hunsepll for spell checking source code comments.
- Host: GitHub
- URL: https://github.com/louis-langholtz/pyspellcode
- Owner: louis-langholtz
- License: zlib
- Created: 2017-12-24T23:10:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-04T01:27:42.000Z (over 7 years ago)
- Last Synced: 2025-04-01T06:02:19.381Z (6 months ago)
- Topics: c-plus-plus, command-line-tool, spell-checker, utility
- Language: Python
- Size: 11.7 KB
- Stars: 10
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# pyspellcode
Python script for using `clang` and `hunspell` for spell checking source code comments.This script parses the [AST dump](http://clang.llvm.org/docs/IntroductionToTheClangAST.html) output from `clang` and runs words found in comment nodes through `hunspell`. It's not perfect, but it's completely IDE independent. It just needs `clang` and `hunspell`. So it should be usable in continuous integration environments like [Travis CI](https://travis-ci.org).
The script accepts command line arguments to fine tune what it does. These arguments are similar to what `clang` and `hunspell` use for doing things like setting which programming language standard to use or adding a personal dictionary file. Note that by default, not all comments are spell checked. Only documentation comments are checked. To check all comments (including regular, non-documentation comments), use the `--all-comments` flag (`-a` for short).
For the most up-to-date command line argument usage, run the script with the `--help` flag (`-h` for short). For example:
```
$ ./spell-check.py --help
usage: spell-check.py [-h] [-v] [-I ] [-std=c++11] [-std=c++14]
[-std=c++17] [-a] [-e] [--show-file-progress]
[-p ]
filename [filename ...]positional arguments:
filename filename to inspectoptional arguments:
-h, --help show this help message and exit
-v, --verbose gets more verbose to aid with diagnostics
-I , --include-dir
adds directory to include search path
-std=c++11 selects the C++11 language standard
-std=c++14 selects the C++14 language standard
-std=c++17 selects the C++17 language standard
-a, --all-comments, -fparse-all-comments
results in checking all comments
-e, -Werror, --error-exit
nonzero exit status for unrecognized words
--show-file-progress shows filenames and results even when no unrecognized
words
-p , --personal-dict
specify the fullpath to a personal dictionary
```