tools/format-cpp: enforce clang-format 13
This patch updates `tools/format-cpp` so that if the `FORMATTER`
environment variable is not empty, the script tries to format with
`$FORMATTER`; otherwise, it tries `clang-format-13 -i` or, if not
available, `clang-format -i`.
In all cases, the script checks the major version of the selected
formatter with `--version`, failing before formatting if it's not 13.
Using exactly clang-format 13 is important for formatting consistency
across developers and CI systems because it's possible that a future
version of clang-format, given the same configuration file, formats
files dissimilarly.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ic81d8d09c35657b602de044f6123e8b11fc37c44
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7151
This page took 0.02397 seconds and 4 git commands to generate.