Configure `clang-format` to pass Linux's `checkpatch.pl` checks

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Configure `clang-format` to pass Linux's `checkpatch.pl` checks

David Blaikie via cfe-dev
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Configure `clang-format` to pass Linux's `checkpatch.pl` checks

David Blaikie via cfe-dev
Hi Miguel,


Regards,
Owen

On Thu, Nov 1, 2018 at 11:28 AM Miguel Sánchez de León Peque via cfe-dev <[hidden email]> 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev