From 109347eea56d3810075c949d987a0b5c8988815f Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sat, 28 Feb 2026 13:51:20 +0100 Subject: [PATCH] docs: Explain how to turn clang-format of for some blocks of code --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6021485..b7a013b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,13 @@ and the `pre-push` hook will be skipped. *Note:* We provide a config file that describes our coding style for clang. But due to a mistake on their side it might happen that you can get a different result that what we expect. See [here](https://github.com/profanity-im/profanity/pull/1774) and [here](https://github.com/profanity-im/profanity/pull/1828) for details. We will try to always run latest clang-format. +In cases where you want to disable automatic formatting for a specific block of code (e.g. a complex lookup table), you can use the following comments: +```c +/* clang-format off */ +// your code +/* clang-format on */ +``` + ## Finding mistakes Test your changes with the following tools to find mistakes.