Add `.clang-format` file for C++ source files
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 19 Nov 2020 18:03:56 +0000 (13:03 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 4 Dec 2020 15:46:49 +0000 (10:46 -0500)
commit35cbc5929c5364a98c3d3e9624e527a37d3234d3
tree75789a099a74374f432e34bdfef409c314fa9d59
parent28b765aca0b943887337e4c707e49475beecea84
Add `.clang-format` file for C++ source files

This patch adds the `.clang-format` file which contains a style to be
applied automatically by the clang-format [1] tool to the project's C++
files.

To apply the style to all the project's C++ files, run:

    $ find -iname '*.cpp' -o -iname '*.hpp' -exec clang-format -i '{}' ';'

As of this patch, the project has no C++ files. This patch is part of an
effort to lay the ground for the introduction of C++ sources in
Babeltrace 2.

I chose to set the `PointerAlignment` style setting to `Left` as
clang-format also uses it for references:

    const char* str

    const std::string& str

[1]: https://clang.llvm.org/docs/ClangFormat.html

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I1def3ec2bf309819878aacef80bd5681d4c44e73
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4423
.clang-format [new file with mode: 0644]
This page took 0.024091 seconds and 4 git commands to generate.