From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) by mx.groups.io with SMTP id smtpd.web08.221.1637103951770892431 for ; Tue, 16 Nov 2021 15:05:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ooP+JGLp; spf=pass (domain: gmail.com, ip: 209.85.222.41, mailfrom: pedro.falcato@gmail.com) Received: by mail-ua1-f41.google.com with SMTP id v3so1636755uam.10 for ; Tue, 16 Nov 2021 15:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=xsOKZWUT6q6M9kGWDOoIz2/Dzp+mdmZmqxYUlQh8ULs=; b=ooP+JGLpyNweiES3Ykko5tGT/TsjSaPvnjDYzWW8CmRBm3OLwunJqxRRJKCGywdjem e6yxVYBDlUrbo6/zoTVbYQbWNpNg3jpP8BiOiYUpsr/ZnB+oaZFHgj9Yn7SL4FXW1xCV h6WQ7TOgLaBzXhQQZ7Z2oiZ0Lq1dAo/tVlCpSMlok6YmSTDvBTADw5XxUQYtkuxGAqa0 eYzkZ5iJ1jIZwxdMdpZy8dCapE+n6Fpgu3xWiZV2qi5d/wFnaVNrVdF7Eo7IZgBV13Bc EkvcHIjAiLV8ecKdEurOxBWMCPXiTWQZti7TteocOGnUYwDCRfK3S2PZpg3ZG8S3FwLZ uJ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=xsOKZWUT6q6M9kGWDOoIz2/Dzp+mdmZmqxYUlQh8ULs=; b=gzZ5e9gYUYGNgvZWhe65vqw3KrZdFsq5jvoypNEOzSedyoQbzcIxkn6aHHyc5ticUX mA5wa4Y2rdKIBmR2i6tcLFeZDnfQcMenXAWnlcubV0pdaitOi6VQpgYOl5OUDqipUhUJ wj++uli6rmNTkH2OVi51D2qJJb2psoc2ucpwRxPuebp8NQi6PaMH3r9jDpLmVM7LtJ1J POGCdyxjsBT28zWN0tpnKj0TeqO74QbD3QEwCegiUzxJ9u4NCPvLXncWdqN7A7h+SIBd dgkRALinz2HejtFq9CWOPzUOqMH67u7x3xyewyEe0Tgy3jS9AB2QDtrXgbbV0v06aufi 7y/A== X-Gm-Message-State: AOAM533CYjDQZgeE5ygTp9QcR07/zAK4+way28IhwqXJI+4s7wI7GLoH dYMtgZ6UayTv8cc4QtYvaqEaJw7OCOzyr7xszbCUKj/jaAhnFA== X-Google-Smtp-Source: ABdhPJwu1wiFJxaBk8Nkl/3Vuqk9IkmJz1s1+nq3b37/SGwcdDTjTCTLw7GtyIrcPKI1KU6QfBsgLqa2JpBzIOsUzjQ= X-Received: by 2002:a05:6102:38d4:: with SMTP id k20mr61917173vst.42.1637103950013; Tue, 16 Nov 2021 15:05:50 -0800 (PST) MIME-Version: 1.0 References: <42fc968b-0108-da06-42a4-d946f0592072@linux.microsoft.com> In-Reply-To: <42fc968b-0108-da06-42a4-d946f0592072@linux.microsoft.com> From: "Pedro Falcato" Date: Tue, 16 Nov 2021 23:05:36 +0000 Message-ID: Subject: Re: [edk2-devel] Uncrustify configuration file and file/function templates To: edk2-devel-groups-io , mikuback@linux.microsoft.com Content-Type: multipart/alternative; boundary="00000000000066a75305d0eff7f7" --00000000000066a75305d0eff7f7 Content-Type: text/plain; charset="UTF-8" Hi, RE: Uncrustify's configuration I had made a few changes to the config file, when trying out Uncrustify, a few months ago, on Mike Kinney's suggestion. In my experience, the new config file reflects the edk2 coding style better. In particular, it adds spaces between things like 'if' and the parenthesis, and better aligns functions' parameters. Feel free to check out the diff: https://gist.github.com/heatd/5bb048a188726cb8bc9f5b4a844b0ec2. There's a bit of diff noise due to it being based on https://dev.azure.com/projectmu/_git/Uncrustify?path=/etc/edk2.cfg but diffed on https://github.com/makubacki/edk2/blob/uncrustify_poc_2/.uncrustify/edk2.cfg . Thanks, Pedro On Tue, Nov 16, 2021 at 7:26 PM Michael Kubacki < mikuback@linux.microsoft.com> wrote: > I think that makes sense. I will look into it further and let you know > if there's any downsides found. > > On 11/16/2021 2:18 PM, Kinney, Michael D wrote: > > Could we add this feature to the Uncrustify CI Plugin? > > > > Mike > > > >> -----Original Message----- > >> From: Michael Kubacki > >> Sent: Tuesday, November 16, 2021 10:54 AM > >> To: devel@edk2.groups.io; Kinney, Michael D > > >> Subject: Re: [edk2-devel] Uncrustify configuration file and > file/function templates > >> > >> I would prefer to have a single version of the file if possible to > >> reduce synchronization issues across the two copies. > >> > >> It seems that a CI plugin to read the contents of the template files and > >> search incoming code for that text wouldn't be too difficult to add as a > >> new plugin. > >> > >> Thanks, > >> Michael > >> > >> On 11/16/2021 1:31 PM, Michael D Kinney wrote: > >>> Hi Michael, > >>> > >>> Should we have 2 versions of the config file? > >>> > >>> One used by automation tools such as CI and git hooks that do not use > the > >>> templates. > >>> > >>> And another one that a developer can optionally use that will add the > >>> templates for missing file/function headers that the developer then > needs > >>> to fill out. > >>> > >>> One concern I have about the templates is if they get used but a > developer > >>> does not fill in the missing information. It would be best if a CI > check > >>> rejects a file/function header that has not been filled in. > >>> > >>> Mike > >>> > >>>> -----Original Message----- > >>>> From: devel@edk2.groups.io On Behalf Of > Michael Kubacki > >>>> Sent: Tuesday, November 16, 2021 10:25 AM > >>>> To: devel@edk2.groups.io; Kinney, Michael D < > michael.d.kinney@intel.com> > >>>> Subject: Re: [edk2-devel] Uncrustify configuration file and > file/function templates > >>>> > >>>> Hi Mike, > >>>> > >>>> Those were just disabled because I typically run a separate invocation > >>>> of Uncrustify with them enabled to isolate code which is missing > >>>> file/function headers. My thought was the templates are helpful but we > >>>> would need to individually identify where they are placed to file > TCBZs > >>>> for maintainers to replace the template with the actual information. > >>>> > >>>> In some of my previous poc branches (like > >>>> > https://github.com/makubacki/edk2/commits/uncrustify_poc_3_with_headers), > I > >>>> also pushed a branch with those results. > >>>> > >>>> So I do think we would want them enabled in the final config file. We > >>>> can also review the contents of the templates in the future patch > series > >>>> to see if any changes are recommended. > >>>> > >>>> I prefer using a .uncrustify directory to help group related > collateral > >>>> but I don't have a strong opinion there. > >>>> > >>>> Thanks, > >>>> Michael > >>>> > >>>> On 11/16/2021 12:16 PM, Michael D Kinney wrote: > >>>>> Hi Michael, > >>>>> > >>>>> In your POC branch ( > https://github.com/makubacki/edk2/tree/uncrustify_poc_5), I see the > >>>>> uncrustify.cfg configuration file in the root. > >>>>> > >>>>> > https://github.com/makubacki/edk2/blob/uncrustify_poc_5/uncrustify.cfg > >>>>> > >>>>> However, in your Wiki, you provide examples where this configuration > file is in an > >>>>> .uncrustify directory > >>>>> > >>>>> > https://dev.azure.com/projectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Project-Mu-(EDK-II)-Fork-Readme > >>>>> > >>>>> The uncrustify.cfg files also contains commented out settings for > the file header > >>>>> and function header templates. > >>>>> > >>>>> # cmt_insert_file_header = default_file_header.txt > >>>>> # cmt_insert_func_header = > default_function_header.txt > >>>>> > >>>>> Are these disabled on purpose? > >>>>> > >>>>> Do we want to enable them? If so, should the uncrustify > configuration file > >>>>> and the templates go into a .uncrustify directory? > >>>>> > >>>>> Thanks, > >>>>> > >>>>> Mike > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>> > >>> > >>> > > > > > > -- Pedro Falcato --00000000000066a75305d0eff7f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

RE: Uncrustify's con= figuration

I had made a few changes to the con= fig file, when trying out Uncrustify, a few months ago, on Mike Kinney'= s suggestion. In my experience, the new config file reflects the edk2 codin= g style better.

In particular, it adds spaces betw= een things like 'if' and the parenthesis, and better al= igns functions' parameters.

Thanks,
Pedro

On Tue, Nov 16, 2021 at 7:26 PM= Michael Kubacki <mikuba= ck@linux.microsoft.com> wrote:
I think that makes sense. I will look into it further= and let you know
if there's any downsides found.

On 11/16/2021 2:18 PM, Kinney, Michael D wrote:
> Could we add this feature to the Uncrustify CI Plugin?
>
> Mike
>
>> -----Original Message-----
>> From: Michael Kubacki <mikuback@linux.microsoft.com>
>> Sent: Tuesday, November 16, 2021 10:54 AM
>> To: deve= l@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
>> Subject: Re: [edk2-devel] Uncrustify configuration file and file/f= unction templates
>>
>> I would prefer to have a single version of the file if possible to=
>> reduce synchronization issues across the two copies.
>>
>> It seems that a CI plugin to read the contents of the template fil= es and
>> search incoming code for that text wouldn't be too difficult t= o add as a
>> new plugin.
>>
>> Thanks,
>> Michael
>>
>> On 11/16/2021 1:31 PM, Michael D Kinney wrote:
>>> Hi Michael,
>>>
>>> Should we have 2 versions of the config file?
>>>
>>> One used by automation tools such as CI and git hooks that do = not use the
>>> templates.
>>>
>>> And another one that a developer can optionally use that will = add the
>>> templates for missing file/function headers that the developer= then needs
>>> to fill out.
>>>
>>> One concern I have about the templates is if they get used but= a developer
>>> does not fill in the missing information.=C2=A0 It would be be= st if a CI check
>>> rejects a file/function header that has not been filled in. >>>
>>> Mike
>>>
>>>> -----Original Message-----
>>>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki=
>>>> Sent: Tuesday, November 16, 2021 10:25 AM
>>>> To: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>=
>>>> Subject: Re: [edk2-devel] Uncrustify configuration file an= d file/function templates
>>>>
>>>> Hi Mike,
>>>>
>>>> Those were just disabled because I typically run a separat= e invocation
>>>> of Uncrustify with them enabled to isolate code which is m= issing
>>>> file/function headers. My thought was the templates are he= lpful but we
>>>> would need to individually identify where they are placed = to file TCBZs
>>>> for maintainers to replace the template with the actual in= formation.
>>>>
>>>> In some of my previous poc branches (like
>>>> https://gith= ub.com/makubacki/edk2/commits/uncrustify_poc_3_with_headers), I
>>>> also pushed a branch with those results.
>>>>
>>>> So I do think we would want them enabled in the final conf= ig file. We
>>>> can also review the contents of the templates in the futur= e patch series
>>>> to see if any changes are recommended.
>>>>
>>>> I prefer using a .uncrustify directory to help group relat= ed collateral
>>>> but I don't have a strong opinion there.
>>>>
>>>> Thanks,
>>>> Michael
>>>>
>>>> On 11/16/2021 12:16 PM, Michael D Kinney wrote:
>>>>> Hi Michael,
>>>>>
>>>>> In your POC branch (http= s://github.com/makubacki/edk2/tree/uncrustify_poc_5), I see the
>>>>> uncrustify.cfg configuration file in the root.
>>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://github.com/makubacki/edk2/blob/uncrustify_poc_5/u= ncrustify.cfg
>>>>>
>>>>> However, in your Wiki, you provide examples where this= configuration file is in an
>>>>> .uncrustify directory
>>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://dev.azure.com/p= rojectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Project-Mu-(EDK-II)-Fork-= Readme
>>>>>
>>>>> The uncrustify.cfg files also contains commented out s= ettings for the file header
>>>>> and function header templates.
>>>>>
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 # cmt_insert_file_header=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D default_file_header.txt
>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 # cmt_insert_func_header=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D default_function_header.txt
>>>>>
>>>>> Are these disabled on purpose?
>>>>>
>>>>> Do we want to enable them?=C2=A0 If so, should the unc= rustify configuration file
>>>>> and the templates go into a .uncrustify directory?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Mike
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>







--
Pedro Falcato
--00000000000066a75305d0eff7f7--