https://github.com/cloderic/clang_format_check
Coding style checker relying on clang-format
https://github.com/cloderic/clang_format_check
Last synced: over 1 year ago
JSON representation
Coding style checker relying on clang-format
- Host: GitHub
- URL: https://github.com/cloderic/clang_format_check
- Owner: cloderic
- License: unlicense
- Created: 2015-04-09T19:04:34.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-11-17T14:37:25.000Z (over 8 years ago)
- Last Synced: 2025-04-12T21:41:49.768Z (over 1 year ago)
- Language: Python
- Size: 215 KB
- Stars: 14
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clang-format check #
:construction: _Still a work in progress, contributions are welcome_ :construction:
[](https://travis-ci.org/cloderic/clang_format_check)
In the spirit of linter and coding style checker such as [jshint](http://jshint.com) or [jscs](http://jscs.info), this helper script relies on [clang-format](http://clang.llvm.org/docs/ClangFormat.html) 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=, (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.
## Install dependencies ##
Run the usual `pip install -r requirements.txt`
## Running tests ##
Simply run [`nosetests`](https://nose.readthedocs.org) 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`.