<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60771>60771</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] feature request: add a DSL, to control clang-format from source.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Febbe
      </td>
    </tr>
</table>

<pre>
    Instead of completely disable clang-format it might be useful, to disable specific options, or change a style temporarily.
It would also allow for better, fine-grained formattings.

Imagine the case, where you have 2 main headers for one source file:

Then currently, only the first is detected as main include.
It would be usefull to have something like

// clang-format pragma: main_include

Which changes the following:

```
#include "a.h"

#include "b.h"
#include "a_test.h"
``` 

automatically into this:

```
#include "a.h"
#include "a_test.h" // clang-format pragma: main_include

#include "b.h"
```

Or the opposite:

```
#include "no/main/include/a.h"

#include "a.h"
#include "b.h"
```

with `// clang-format pragma: no_main_include` into this:

```
#include "a.h"

#include "b.h"
#include "no/main/include/a.h" // clang-format pragma: no_main_include
```

In the best case, all possible options are covered somehow.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysldFr-0YMx_-a84tocM5xUj_4oVsIFAZ72GCPRT7LvtvOJ-9Obsh_P-z61yWBtqwMQgyW9dVXH51lTMn1gahW5U-qPGY4ieVYn6hpKGu4vdTPIQlhC9yB4WH0JOQv0LqEjScwHkP_0HEcUMAJDK63Ag3BlKibvNI_g_D702kk4zpngEdxHNIc5gjGYugJEJJcPIHQMHLE6Pxlo_Kjyp-eBc48-RbQJwb0ns_QcYSGRCjOKp0L9NBHdIFaeLMjLvRpFVhlBuxdIBBLYDDRnHi2FAkuPIHFVwINA7oAlrClmJYiHAgST9EQdM6TKp6uNX-3FMBMMVIQf1kaCv6ylOhcTAIuQUtCRqgFTG_yLhg_tXTf3Ts2P0Nb_CQeSKwLPXj3F10XVvqk9Ol2AGPEfkBVPC1lXtYy11l_WGfsCjy9ueQZpwv9XWNqn6-_tVyxyoHSGjdWaX1r5zreXMdvM1-EklyHf9SBazmchAcUZ9D7C7ggDGJd-rbHjzzA9zB-0u2dpeX_17ig5nHk5OT-CH3aRWClT7MNpU8_jOjTV_w_7v1Lr2cnFuZ7n4IJ_HLDZp__D0P6TwfpMzBfTPXe_McwnsMyuIaSvG8M9B5GTsnNG21dZICRwPArRWqXd9byeZO1ddFWRYUZ1dv9Yb877B4ft5mtu64s8qrb7ar2UJmqxKJ67DrSO9yaoqEqc7XOdZHrbbkt9WO-3XRlsSU8VKZDqvSW1C6nAZ3feP86bDj2mUtponqfHw7bzGNDPi0rXetAZ1iCM8fymMV6znlopj6pXe5dkvSvijjxy7fgmpwqj9ARyhQJIv09UZKZIrYtIBx_-2Vd8oaDRPa30LvIw7o9N9kUfW1FxuWELBPqndip2RgelD7NLtbLwxj5TzIyz3b2npQ-Lb39EwAA__9J9wqp">