clang format ci job and build-type-specific cache keys
Added a clang-format-all.sh
script and ci job that checks that all formatting is correct.
We need clang-format 8 or newer, otherwise the result is not the same (see the updated source files).
On cvai machines you can install by:
sudo apt install llvm-8-repo
sudo apt update
sudo apt install clang-format-8
or
sudo apt install llvm-snapshot-repo
sudo apt update
sudo apt install clang-format-9
I added IncludeBlocks: Preserve
, because in recent clang-format-9 the default changed, and we want to keep the old behaviour for now.
The clang-format-all.sh
implementation is so complicated, because it does version checking, and on macos the executable (from homebrew) is called clang-format
, whereas on Ubuntu we need to use clang-format-8
or clang-format-9
.
The ci image doesn't have clang-format it seems, so for now I'm using one from another project. I guess we should maybe add it to the basalt image.
Also make the cache keys different for different build types in ci.