lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

Better CI Format Check #466

Closed nosracd closed 11 months ago

nosracd commented 11 months ago

Different versions of clang-format format differently. The CI uses clang-format-12 for consistency, but format_code.sh does not specify a version. This can result in situations where format_code.sh reports well-formatted code locally but not on the CI, such as in this case.

b1c8fece231c77014e4def55a87650d98e53854a remedies this by forcing format_code.sh to use clang-format-12 and instructing the user to install that particular version if it's not available.

Unfortunately, this means that some people are much older or newer distributions might not be able to use the formatter locally. While docker is always an option, 6932d24b2dca653cafd871f4dc82c4725baa4c8a attempts to ease this pain by printing the desired format on the CI (example CI success, example CI failure).