InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

clang-format: Update to 16

Open FintasticMan opened this issue 1 year ago • 9 comments

As discussed in #2127. I've also updated the clang-format options to be compatible, and sorted the options.

FintasticMan avatar Oct 09 '24 15:10 FintasticMan

Build size and comparison to main:

Section Size Difference
text 374512B -16B
data 948B 0B
bss 63488B 0B

github-actions[bot] avatar Oct 09 '24 15:10 github-actions[bot]

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?

FintasticMan avatar Oct 10 '24 10:10 FintasticMan

Yeah may as well do it all in one go I think, it makes sense to do the upgrade atomically

mark9064 avatar Oct 10 '24 22:10 mark9064

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.

FintasticMan avatar Oct 11 '24 14:10 FintasticMan

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.

FintasticMan avatar Oct 27 '24 17:10 FintasticMan

Oh, what's up with clang-tidy 16?

mark9064 avatar Oct 27 '24 21:10 mark9064

Now I look at this, isn't clang-tidy just completely broken

mark9064 avatar Jun 02 '25 18:06 mark9064

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

mark9064 avatar Jun 03 '25 20:06 mark9064

Should probably link an explanation for that: https://github.com/llvm/llvm-project/issues/53468

mark9064 avatar Jun 05 '25 15:06 mark9064