InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.74k stars 936 forks source link

Update clang-{format,tidy} to 14 #1509

Closed FintasticMan closed 1 year ago

FintasticMan commented 1 year ago

Now that the GH Actions VMs have updated to Ubuntu 22.04, clang can be updated to 14 over 12. I've looked through all the clang-format options that have been added in 13 and 14, and added the ones I believe fit our coding style. These options are: EmptyLineAfterAccessModifier: Never, IndentAccessModifiers: false, PackConstructorInitializers: NextLine, ReferenceAlignment: Pointer and SeparateDefinitionBlocks: Always. All of these except the last one don't actually change the formatting at all, just prevent any incorrect formatting in the future. The last one adds some new lines between definition blocks in some cases.

This change fixes a compiler error in the clang-tidy check, about the -fstack-usage flag.

FintasticMan commented 1 year ago

Turns out, not all options that apply to this codebase from clang-format 12 have been added to the configuration, EmptyLineBeforeAccessModifier: LogicalBlock and SpaceBeforeCaseColon: false were missed. They don't affect existing code.