bluekitchen / btstack

Dual-mode Bluetooth stack, with small memory footprint.
http://bluekitchen-gmbh.com
Other
1.74k stars 618 forks source link

compile_gatt.py: add clang-format off to header #553

Closed ricardoquesada closed 10 months ago

ricardoquesada commented 11 months ago

Add clang-format off to header. Useful when the auto-generated headers are checked-in a repo with clang-format enabled.

mringwal commented 10 months ago

No problem adding that line to the generated output. Would it be possible to generate the code in a way that makes clang-format happy, or does this depend on the clang-format the user has chosen?

ricardoquesada commented 10 months ago

The format used by clang-format varies from project to project. Usually a file called .clang-format is placed in the root folder (e.g: https://github.com/ricardoquesada/bluepad32/blob/main/.clang-format )

And in the CI you have a simple rule that checks whether the pull-request has the correct format. (e.g: https://github.com/ricardoquesada/bluepad32/blob/main/.github/workflows/clang-format-check.yaml )

Unfortunately clang-format doesn't (AFAIK) have a way to tell "ignore this file" when running the check. It supports "ignore folders", but doesn't support "ignore individual files"