Skip to content

C Code Formatting

James Hunter edited this page Sep 14, 2018 · 2 revisions

We use the "AStyle Extension 2017" plugin for Visual Studio, to format C++ code; Artistic Style plugins are available for various editors.

Our settings:

--style=google --indent=spaces=2 --max-instatement-indent=40 --align-pointer=type --align-reference=type --max-code-length=100 --attach-namespaces --attach-classes --unpad-paren --close-templates --keep-one-line-statements --break-after-logical --mode=c

Please use these AStyle settings when submitting C++ pull requests, as it makes merges easier.

We also wrap columns at 100 characters. To make wrapping easier, I use the "Editor Guidelines" plugin for Visual Studio, and add a guideline at 100 characters.

Clone this wiki locally