public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] edk2 uncrustify update (73.0.8)?
@ 2023-11-13 11:58 Laszlo Ersek
  2023-11-13 12:29 ` Marcin Juszkiewicz
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Laszlo Ersek @ 2023-11-13 11:58 UTC (permalink / raw)
  To: edk2-devel-groups-io, Michael Kubacki
  Cc: Michael Kinney, Pedro Falcato, Andrew Fish, Marcin Juszkiewicz,
	Leif Lindholm (Quic)

Hi Michael,

recently I encountered an uncrustify failure on github.

The reason was that my local uncrustify was *more recent* (73.0.8) than
the one we use in edk2 CI (which is 73.0.3, per the edk2 file
".pytool/Plugin/UncrustifyCheck/uncrustify_ext_dep.yaml").

Updating the version number in the YAML file (i.e., advancing edk2 to
version 73.0.8) seems easy enough, but:

- Do you think 73.0.8 is mature enough for adoption in edk2?

  This upstream uncrustify release was tagged in April (and I can't see
  any more recent commits), so I assume it should be stable.

- Would the version update require a whole-tree re-uncrustification?

The reason I'm not just ignoring this topic is that 73.0.8 actually
produces *better output* than 73.0.3, at least in the one instance I
encountered. Compare:

> diff --git a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
> index 434cdca84b23..3a6f75988220 100644
> --- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
> +++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
> @@ -43,12 +43,12 @@ STATIC EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL
>  STATIC CONST EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR  mMmio64Configuration = {
>    ACPI_ADDRESS_SPACE_DESCRIPTOR,                   // Desc
>    (UINT16)(                                        // Len
> -                                                   sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
> -                                                   OFFSET_OF (
> -                                                     EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
> -                                                     ResType
> -                                                     )
> -                                                   ),
> +    sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
> +    OFFSET_OF (
> +      EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
> +      ResType
> +      )
> +    ),
>    ACPI_ADDRESS_SPACE_TYPE_MEM,                     // ResType
>    0,                                               // GenFlag
>    0,                                               // SpecificFlag
> @@ -77,12 +77,12 @@ STATIC CONST EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR  mMmio64Configuration = {
>  STATIC CONST EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR  mOptionRomConfiguration =   {
>    ACPI_ADDRESS_SPACE_DESCRIPTOR,                   // Desc
>    (UINT16)(                                        // Len
> -                                                   sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
> -                                                   OFFSET_OF (
> -                                                     EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
> -                                                     ResType
> -                                                     )
> -                                                   ),
> +    sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) -
> +    OFFSET_OF (
> +      EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR,
> +      ResType
> +      )
> +    ),
>    ACPI_ADDRESS_SPACE_TYPE_MEM,                     // ResType
>    0,                                               // GenFlag
>    0,                                               // Disable option roms SpecificFlag

Note that 73.0.3 indents the subexpression to the "//"  comment on the
previous line, while 73.0.8 ignores the comment -- which I think is
justified here.

I believe this improvement may come from uncrustify commit 239c4fad745b
("Prevent endless indentation scenario in struct assignment",
2022-07-29). I think it's worth having in edk2.

CC: stewards, Pedro (commit 6ded9f50c3aa), Marcin (traditionally a big
fan of uncrustify :))

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111147): https://edk2.groups.io/g/devel/message/111147
Mute This Topic: https://groups.io/mt/102559740/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-11-23  2:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-13 11:58 [edk2-devel] edk2 uncrustify update (73.0.8)? Laszlo Ersek
2023-11-13 12:29 ` Marcin Juszkiewicz
2023-11-13 19:14   ` Rebecca Cran via groups.io
2023-11-13 20:37     ` Michael Kubacki
2023-11-13 19:07 ` Pedro Falcato
2023-11-13 20:21   ` Michael Kubacki
2023-11-13 21:05     ` Michael D Kinney
2023-11-14 14:51   ` Laszlo Ersek
2023-11-14 15:12     ` Rebecca Cran via groups.io
2023-11-15  8:52       ` Laszlo Ersek
     [not found] ` <17974449E158DE38.1153@groups.io>
2023-11-13 19:10   ` Pedro Falcato
2023-11-13 20:08 ` Michael Kubacki
2023-11-13 20:37   ` Rebecca Cran
2023-11-13 21:33     ` Pedro Falcato
2023-11-14 15:01       ` Laszlo Ersek
2023-11-16  8:29         ` Pedro Falcato
2023-11-16 17:36           ` Michael Kubacki
2023-11-23  2:07             ` Pedro Falcato
2023-11-17  9:08           ` Laszlo Ersek
2023-11-23  1:44             ` Pedro Falcato
2023-11-14  1:46     ` Michael Kubacki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox