How to use ClangFormat with Cinder
Install ClangFormat via your platform's package manager. On windows, download the installer and Visual Studio plugin from LLVM.
Download the .clang-format
file from this Gist and save it to the root directory of your Cinder repo.
Format whole files from Terminal
clang-format -i -style=file [<file> ...]
From Sublime Text 3
Download the Clang Format plugin from Package Control (or manually).
Run the Clang Format: Select Style
command and choose File
. This will instruct clang-format to search up the directory tree and use the first .clang-format file it finds.
Select a few lines of source code and run Clang Format: Format Selection
.
From Xcode
Check out ClangFormat-Xcode.
Known issues
These are things that differ from Cinder's code style but cannot be specified in ClangFormat.
- A space is not inserted after the
!
boolean operator. - Cinder has no enforced maximum line length, so array declarations tend to stay on one line.
Improvements
If you find a place where this file fails to match Cinder's coding style, please fork this Gist and leave a comment!
This comment has been minimized.
thanks Ryan!