docs: Explain how to turn clang-format of for some blocks of code

This commit is contained in:
Michael Vetter
2026-02-28 13:51:20 +01:00
parent b0abb64950
commit 109347eea5

View File

@@ -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.