clang-format: Update to 16
As discussed in #2127. I've also updated the clang-format options to be compatible, and sorted the options.
Build size and comparison to main:
| Section | Size | Difference |
|---|---|---|
| text | 374512B | -16B |
| data | 948B | 0B |
| bss | 63488B | 0B |
Sorry for the force push spam :sweat_smile:. GitHub doesn't have an easy way to test CI locally, so I just did it in this PR. The failing clang-tidy test is because the infinitime-build container still uses Ubuntu 22.04. I think the reason we use the docker container in that check is to generate the compile_commands.json file that clang-tidy uses. Should I also update the docker container in this PR?
Yeah may as well do it all in one go I think, it makes sense to do the upgrade atomically
I've actually just thought that we don't necessarily need to update clang-tidy at the same time as clang-format, they don't interact at all. I might just revert the clang-tidy version bump and keep this PR to only updating clang-format.
I agree that clang-tidy 14 with clang-format 16 is a bit of a strange setup, but I think that it's fine for the interim while I get clang-tidy 16 working.
Oh, what's up with clang-tidy 16?
Now I look at this, isn't clang-tidy just completely broken
A working clang-tidy invocation: clang-tidy -p build $($ARM_NONE_EABI_TOOLCHAIN_PATH/bin/arm-none-eabi-g++ -E -Wp,-v -xc++ /dev/null 1>/dev/null 2>&1 | grep ' /' | sed 's/ \//\//' | xargs realpath | sed 's/^/-extra-arg=-isystem/' | tr '\n' ' ') src/main.cpp
Should probably link an explanation for that: https://github.com/llvm/llvm-project/issues/53468