🚧 Still a work in progress, contributions are welcome 🚧
In the spirit of linter and coding style checker such as jshint or jscs, this helper script relies on clang-format to check and report coding style issues in C and C++ codebases.
usage: clang_format_check.py [-h] [-s STYLE]
[--success-on-missing-clang-format]
file [file ...]
C/C++ formatting check using clang-format
positional arguments:
file Paths to the files that'll be checked (wilcards
accepted).
optional arguments:
-h, --help show this help message and exit
-s STYLE, --style STYLE
Coding style, pass-through to clang-format's
-style=<string>, (default is 'file').
--success-on-missing-clang-format
If set this flag will lead to a success (zero exit
status) if clang-format is not available.
Run the usual pip install -r requirements.txt
Simply run nosetests
to launch the script on all .cpp
files under test/data
.
- All tests are run with the file style, they'll rely on their
.clang-format
file. - All files ending with
...ok.cpp
should be valid. - All files ending with
...ko.cpp
should be invalid, the tool outputs should match the accompanying...ko.cpp.out
.