Page tree
Skip to end of metadata
Go to start of metadata

This page documents how source code autoformatting tools can be used to enforce the Zubax C++ coding conventions.

clang-format

Unlike AStyle or Uncrustify, clang-format doesn't tend to break your code or introduce nonsensical changes. The configuration file below requires clang-format version 8 or newer. Note that clang-format can't enforce brace placement and some other things; consider using clang-tidy for that.

_clang-format

Put the config file in the sources' root directory, then run from the same directory:

Invoking clang-format
clang-format -i -fallback-style=none -style=file src/*.[ch]pp

Eclipse IDE autoformatter

Configuration file for the Eclipse autoformatter is attached below. Eclipse's embedded autoformatter is quite limited in its capabilities, so one should not rely on it too much.

eclipse_formatter.xml