<div dir="ltr">Hello,<br><br>to evaluate the effort needed to adapt clang-format for RTEMS, we are currently trying to implement the option to put the ")" at the<br>end of a function declaration in a separate line, e.g.:<br><br>bool _Thread_Initialize(<br>   Thread_Information                   *information,<br>[...]<br>   Objects_Name                          name<br>) // <- in a new line<br><div>{</div><div><br></div><div>I asked for help in the clang mailing list, but it does not seem like there is a person who is willing to mentor me in getting used to the clang-format code and the tools it depends on. It looks like they don't have much interest to invest time in a private patch.<br></div><div><br></div><div>Currently I am using QtCreator to load the LLVM cmake and build the project. It is possible to use the Debugger to trace the execution of clang-format. <br></div><div><br></div><div>In my view, with the help of QtCreator and the debugger it should be possible to adapt clang-format for RTEMS in a reasonable amount of time. But since it is an extensive project, it will take some time to understand the code and to feel comfortable enough to implement new functionality.<br></div><div><br></div><div>Best,<br></div><div>Mikail<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 17, 2018 at 1:44 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Mikail,<br>
<br>
thanks for your summary. I tried a couple for C code formatters for <br>
RTEMS in the last couple of years and none delivered sufficiently good <br>
results. My hope was that we could use clang-format with some additions <br>
for RTEMS. However, it seems the hurdle to add new style options to <br>
clang-format is quite high:<br>
<br>
<a href="https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options" rel="noreferrer" target="_blank">https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options</a><br>
<br>
<br>
"The goal of the clang-format project is more on the side of supporting <br>
a limited set of styles really well as opposed to supporting every <br>
single style used by a codebase somewhere in the wild. Of course, we do <br>
want to support all major projects and thus have established the <br>
following bar for adding style options. Each new style option must ..<br>
<br>
      * be used in a project of significant size (have dozens of<br>
        contributors)<br>
      * have a publicly accessible style guide<br>
      * have a person willing to contribute and maintain patches"<br>
<br>
I am not sure if RTEMS would count as a project of "significant size".<br>
<br>
See also:<br>
<br>
<a href="http://lists.llvm.org/pipermail/cfe-dev/2018-December/060560.html" rel="noreferrer" target="_blank">http://lists.llvm.org/pipermail/cfe-dev/2018-December/060560.html</a><br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : +49 89 189 47 41-16<br>
Fax     : +49 89 189 47 41-09<br>
E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</blockquote></div>