<div dir="ltr"><div>Yes, I do.</div><div><br></div><div>Essentially, my changes make it so the function parameters are aligned and there are always two spaces between the parameter's type and name; it also adds spaces between control statements, as you mentioned.</div><div>"force" instead of "add" for sp_before_sparen is a good idea though.</div><div>I assume these are good additions to the "upstream" edk2.cfg?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 16, 2021 at 11:20 PM Michael Kubacki <<a href="mailto:mikuback@linux.microsoft.com">mikuback@linux.microsoft.com</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">Hi Pedro,<br>
<br>
By "new config", do you mean the config file in the latest branch <br>
<a href="https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg</a>)?<br>
<br>
The main difference I see from the diff in that gist and poc_5 is that <br>
"align_func_params_gap" and "align_func_params_span" are two instead of <br>
zero.<br>
<br>
The value "force" instead of "add" for "sp_before_sparen" will ensure a <br>
single space is always added between a control statement and the <br>
parenthesis.<br>
<br>
Thanks,<br>
Michael<br>
<br>
On 11/16/2021 6:05 PM, Pedro Falcato wrote:<br>
> Hi,<br>
> <br>
> RE: Uncrustify's configuration<br>
> <br>
> I had made a few changes to the config file, when trying out Uncrustify, <br>
> a few months ago, on Mike Kinney's suggestion. In my experience, the new <br>
> config file reflects the edk2 coding style better.<br>
> <br>
> In particular, it adds spaces between things like 'if' and the <br>
> parenthesis, and better aligns functions' parameters.<br>
> Feel free to check out the diff: <br>
> <a href="https://gist.github.com/heatd/5bb048a188726cb8bc9f5b4a844b0ec2" rel="noreferrer" target="_blank">https://gist.github.com/heatd/5bb048a188726cb8bc9f5b4a844b0ec2</a> <br>
> <<a href="https://gist.github.com/heatd/5bb048a188726cb8bc9f5b4a844b0ec2" rel="noreferrer" target="_blank">https://gist.github.com/heatd/5bb048a188726cb8bc9f5b4a844b0ec2</a>>. <br>
> There's a bit of diff noise due to it being based on <br>
> <a href="https://dev.azure.com/projectmu/_git/Uncrustify?path=/etc/edk2.cfg" rel="noreferrer" target="_blank">https://dev.azure.com/projectmu/_git/Uncrustify?path=/etc/edk2.cfg</a> <br>
> <<a href="https://dev.azure.com/projectmu/_git/Uncrustify?path=/etc/edk2.cfg" rel="noreferrer" target="_blank">https://dev.azure.com/projectmu/_git/Uncrustify?path=/etc/edk2.cfg</a>> but <br>
> diffed on <br>
> <a href="https://github.com/makubacki/edk2/blob/uncrustify_poc_2/.uncrustify/edk2.cfg" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/blob/uncrustify_poc_2/.uncrustify/edk2.cfg</a> <br>
> <<a href="https://github.com/makubacki/edk2/blob/uncrustify_poc_2/.uncrustify/edk2.cfg" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/blob/uncrustify_poc_2/.uncrustify/edk2.cfg</a>>.<br>
> <br>
> Thanks,<br>
> Pedro<br>
> <br>
> On Tue, Nov 16, 2021 at 7:26 PM Michael Kubacki <br>
> <<a href="mailto:mikuback@linux.microsoft.com" target="_blank">mikuback@linux.microsoft.com</a> <mailto:<a href="mailto:mikuback@linux.microsoft.com" target="_blank">mikuback@linux.microsoft.com</a>>> wrote:<br>
> <br>
>     I think that makes sense. I will look into it further and let you know<br>
>     if there's any downsides found.<br>
> <br>
>     On 11/16/2021 2:18 PM, Kinney, Michael D wrote:<br>
>      > Could we add this feature to the Uncrustify CI Plugin?<br>
>      ><br>
>      > Mike<br>
>      ><br>
>      >> -----Original Message-----<br>
>      >> From: Michael Kubacki <<a href="mailto:mikuback@linux.microsoft.com" target="_blank">mikuback@linux.microsoft.com</a><br>
>     <mailto:<a href="mailto:mikuback@linux.microsoft.com" target="_blank">mikuback@linux.microsoft.com</a>>><br>
>      >> Sent: Tuesday, November 16, 2021 10:54 AM<br>
>      >> To: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <mailto:<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>>; Kinney,<br>
>     Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a><br>
>     <mailto:<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>>><br>
>      >> Subject: Re: [edk2-devel] Uncrustify configuration file and<br>
>     file/function templates<br>
>      >><br>
>      >> I would prefer to have a single version of the file if possible to<br>
>      >> reduce synchronization issues across the two copies.<br>
>      >><br>
>      >> It seems that a CI plugin to read the contents of the template<br>
>     files and<br>
>      >> search incoming code for that text wouldn't be too difficult to<br>
>     add as a<br>
>      >> new plugin.<br>
>      >><br>
>      >> Thanks,<br>
>      >> Michael<br>
>      >><br>
>      >> On 11/16/2021 1:31 PM, Michael D Kinney wrote:<br>
>      >>> Hi Michael,<br>
>      >>><br>
>      >>> Should we have 2 versions of the config file?<br>
>      >>><br>
>      >>> One used by automation tools such as CI and git hooks that do<br>
>     not use the<br>
>      >>> templates.<br>
>      >>><br>
>      >>> And another one that a developer can optionally use that will<br>
>     add the<br>
>      >>> templates for missing file/function headers that the developer<br>
>     then needs<br>
>      >>> to fill out.<br>
>      >>><br>
>      >>> One concern I have about the templates is if they get used but<br>
>     a developer<br>
>      >>> does not fill in the missing information.  It would be best if<br>
>     a CI check<br>
>      >>> rejects a file/function header that has not been filled in.<br>
>      >>><br>
>      >>> Mike<br>
>      >>><br>
>      >>>> -----Original Message-----<br>
>      >>>> From: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <mailto:<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>><br>
>     <<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <mailto:<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>>> On Behalf Of<br>
>     Michael Kubacki<br>
>      >>>> Sent: Tuesday, November 16, 2021 10:25 AM<br>
>      >>>> To: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a> <mailto:<a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a>>;<br>
>     Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a><br>
>     <mailto:<a href="mailto:michael.d.kinney@intel.com" target="_blank">michael.d.kinney@intel.com</a>>><br>
>      >>>> Subject: Re: [edk2-devel] Uncrustify configuration file and<br>
>     file/function templates<br>
>      >>>><br>
>      >>>> Hi Mike,<br>
>      >>>><br>
>      >>>> Those were just disabled because I typically run a separate<br>
>     invocation<br>
>      >>>> of Uncrustify with them enabled to isolate code which is missing<br>
>      >>>> file/function headers. My thought was the templates are<br>
>     helpful but we<br>
>      >>>> would need to individually identify where they are placed to<br>
>     file TCBZs<br>
>      >>>> for maintainers to replace the template with the actual<br>
>     information.<br>
>      >>>><br>
>      >>>> In some of my previous poc branches (like<br>
>      >>>><br>
>     <a href="https://github.com/makubacki/edk2/commits/uncrustify_poc_3_with_headers" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/commits/uncrustify_poc_3_with_headers</a><br>
>     <<a href="https://github.com/makubacki/edk2/commits/uncrustify_poc_3_with_headers" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/commits/uncrustify_poc_3_with_headers</a>>),<br>
>     I<br>
>      >>>> also pushed a branch with those results.<br>
>      >>>><br>
>      >>>> So I do think we would want them enabled in the final config<br>
>     file. We<br>
>      >>>> can also review the contents of the templates in the future<br>
>     patch series<br>
>      >>>> to see if any changes are recommended.<br>
>      >>>><br>
>      >>>> I prefer using a .uncrustify directory to help group related<br>
>     collateral<br>
>      >>>> but I don't have a strong opinion there.<br>
>      >>>><br>
>      >>>> Thanks,<br>
>      >>>> Michael<br>
>      >>>><br>
>      >>>> On 11/16/2021 12:16 PM, Michael D Kinney wrote:<br>
>      >>>>> Hi Michael,<br>
>      >>>>><br>
>      >>>>> In your POC branch<br>
>     (<a href="https://github.com/makubacki/edk2/tree/uncrustify_poc_5" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/tree/uncrustify_poc_5</a><br>
>     <<a href="https://github.com/makubacki/edk2/tree/uncrustify_poc_5" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/tree/uncrustify_poc_5</a>>), I see the<br>
>      >>>>> uncrustify.cfg configuration file in the root.<br>
>      >>>>><br>
>      >>>>><br>
>     <a href="https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg</a><br>
>     <<a href="https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg" rel="noreferrer" target="_blank">https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg</a>><br>
>      >>>>><br>
>      >>>>> However, in your Wiki, you provide examples where this<br>
>     configuration file is in an<br>
>      >>>>> .uncrustify directory<br>
>      >>>>><br>
>      >>>>><br>
>     <a href="https://dev.azure.com/projectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Project-Mu-(EDK-II)-Fork-Readme" rel="noreferrer" target="_blank">https://dev.azure.com/projectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Project-Mu-(EDK-II)-Fork-Readme</a><br>
>     <<a href="https://dev.azure.com/projectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Project-Mu-(EDK-II)-Fork-Readme" rel="noreferrer" target="_blank">https://dev.azure.com/projectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Project-Mu-(EDK-II)-Fork-Readme</a>><br>
>      >>>>><br>
>      >>>>> The uncrustify.cfg files also contains commented out settings<br>
>     for the file header<br>
>      >>>>> and function header templates.<br>
>      >>>>><br>
>      >>>>>        # cmt_insert_file_header          =<br>
>     default_file_header.txt<br>
>      >>>>>        # cmt_insert_func_header          =<br>
>     default_function_header.txt<br>
>      >>>>><br>
>      >>>>> Are these disabled on purpose?<br>
>      >>>>><br>
>      >>>>> Do we want to enable them?  If so, should the uncrustify<br>
>     configuration file<br>
>      >>>>> and the templates go into a .uncrustify directory?<br>
>      >>>>><br>
>      >>>>> Thanks,<br>
>      >>>>><br>
>      >>>>> Mike<br>
>      >>>>><br>
>      >>>>><br>
>      >>>>><br>
>      >>>>><br>
>      >>>>><br>
>      >>>>><br>
>      >>>>><br>
>      >>>><br>
>      >>>><br>
>      >>>><br>
>      >>>><br>
>      >>><br>
>      >>><br>
>      >>><br>
>      >>><br>
>      >>><br>
>      >>><br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> -- <br>
> Pedro Falcato
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Pedro Falcato</div></div>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/83796">View/Reply Online (#83796)</a> |    |  <a target="_blank" href="https://groups.io/mt/87100207/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>