Skip to content

Code style checking

Leonid Genkin edited this page Nov 25, 2020 · 19 revisions

We use clang-format for automatic check of commit compliance with our code style.

clang >=11 and git-clang-format are required to run the check.

git-clang-format must be run in the root directory of the repository - the style rules are defined in .clang-format file which is located there.

Invoking git-clang-format will check and fix files which were changed between HEAD and the working directory (only the modified lines are affected by formatting - git-clang-format doesn't check pre-existing code).

It is also possible to run the check on a particular commits diff, see git-clang-format -h for options.

Currently the code style check is experimental and is recommended to be performed locally by each contributor when opening a PR

Clone this wiki locally