[cfe-dev] Configure `clang-format` to pass Linux's `checkpatch.pl` checks

Owen Pan via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 1 21:33:15 PDT 2018


Hi Miguel,

Please see my answer here: https://stackoverflow.com/a/53112676/10594032

Regards,
Owen

On Thu, Nov 1, 2018 at 11:28 AM Miguel Sánchez de León Peque via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
>
> I am using `clang-format` to automatically format all the C code I
> produce. Then, in my CI pipelines, I am executing Linux's
> `checkpatch.pl`[0] script to verify the style matches the one expected
> by the Linux kernel style guide[1].
>
> Until very recently, that worked just fine, but I have now found a case
> were it does not.
>
> The question I have is better explained (and includes the required C
> source code) in Stack Overflow:
>
> https://stackoverflow.com/questions/53094436/
>
> Basically, I am initializing an array of structs and `clang-format` is
> breaking braces "{", but that is something `chekcpatch.pl` would not
> allow. I am unable to find a `clang-format` configuration that prevents
> those breaks before the braces.
>
> Thanks in advance for your help,
>
> Miguel
>
> [0]:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl
> [1]: https://www.kernel.org/doc/html/v4.10/process/coding-style.html
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181101/ce1d60c3/attachment.html>


More information about the cfe-dev mailing list