Skip to content
peterfpeterson edited this page Dec 5, 2014 · 22 revisions

This page describes how to use and configure clang-format (v3.4). clang-format is a command line tool built on top of llvm that enforces whitespace conventions for c/c++ code. The configuration for it (.clang-format) is in the root directory of the repository and is discovered by the tool automatically. Mantid uses the llvm style.

Setting up git to format

There is a tool, git-clang-format which adds support to git to automatically format code that is added before it is committed. This only changes the formatting of the lines that you have already edited.

Configure your favorite IDE or editor for using clang-format

Most everything can attach to clang-format. The list in clang-format's documentation.

Others have plugins/config from other sources:

Clone this wiki locally