Add `tools/format-cpp` script
[babeltrace.git] / tools / format-cpp
1 #!/bin/bash
2 #
3 # SPDX-License-Identifier: GPL-2.0-only
4 #
5 # Copyright (C) 2020 Philippe Proulx <pproulx@efficios.com>
6
7 FORMATTER="${FORMATTER:-clang-format -i}"
8 root_dir="$(dirname "${BASH_SOURCE[0]}")/.."
9 find "$root_dir" \( -name '*.cpp' -o -name '*.hpp' \) \
10 ! -wholename '*/cpp-common/optional.hpp' \
11 ! -wholename '*/cpp-common/string_view.hpp' \
12 -exec $FORMATTER '{}' ';'
This page took 0.029226 seconds and 4 git commands to generate.