From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.16199.1685719352341680626 for ; Fri, 02 Jun 2023 08:22:32 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=s5wiLBAe; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 7068C20FCD5B; Fri, 2 Jun 2023 08:22:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7068C20FCD5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1685719351; bh=vLqitmkA6PpfC/i5vzvteKulqYloOIHYKV9sbgvXqCU=; h=Date:Subject:From:To:Cc:Reply-To:References:In-Reply-To:From; b=s5wiLBAeo9//2jb21AEkgjO/EVhS0v8vjg0cpxxSB5wYRLP21Y6+h44h8+Dd0JXL+ 4ab2kxh/zdg+wp0Wg0kypdbrjrkI81nrBulZduZGmK1OH38f/8w/t30Qv5Gm06jnEd yCVSjlb/5cOBQAGEfWQWODuUJNDx7p1E6v5JxR/k= Message-ID: <4262e265-dcb2-b254-9bc6-f49a3da6d5af@linux.microsoft.com> Date: Fri, 2 Jun 2023 11:22:29 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [edk2-devel] [RFC PATCH] ArmPkg: Enable AuditMode for Uncrustify CI checks From: "Michael Kubacki" To: devel@edk2.groups.io, ardb@kernel.org Cc: Leif Lindholm , "Kinney, Michael D" Reply-To: devel@edk2.groups.io, mikuback@linux.microsoft.com References: <20230602085136.3552790-1-ardb@kernel.org> <1764E0991FEF04DA.11185@groups.io> In-Reply-To: <1764E0991FEF04DA.11185@groups.io> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sorry, this message was accidentally sent while I was adjusting=20 formatting. I reply to the original mail with a clean reply. On 6/2/2023 11:18 AM, Michael Kubacki wrote: > Hi Ard, >=20 > Are there particular areas that could be improved to make it more usable= =20 > for you? I'm trying to find actionable improvements that can be made, if= =20 > any. >=20 > I know it's not perfect but developers can run it with a single keyboard= =20 > shortcut and it's been useful internally for eliminating style minutia=20 > from distracting design and correctness conversation in code reviews. >=20 >=20 >=20 >=20 > > - finding out from the web UI what exactly Uncrustify objected to is n= ot > >=C2=A0=C2=A0=C2=A0 straight-forward. > > > This should not be necessary. It can be run locally to produce the same= =20 > result as in CI. >=20 > IDE-specific, but a lot of people use VS Code with the Uncrustify=20 > extension=20 > (https://marketplace.visualstudio.com/items?itemName=3Dzachflower.uncrust= ify) and that allows Uncrustify to be run against the open source file by s= imply pressing the "code formatter" command. >=20 > I usually write the code stage or commit it and then run this command on= =20 > the file. The code is formatted and it gives a normal local diff of=20 > exactly what Uncrustify changed. >=20 >=20 > On 6/2/2023 4:51 AM, Ard Biesheuvel wrote: >> Uncrustify checks are too rigid, making them counter-productive: >> >> - it leads to code that is arguably harder to parse visually (e.g., >> =C2=A0=C2=A0 the changes to ArmPkg/Include/Chipset/AArch64Mmu.h in commi= t >> =C2=A0=C2=A0 429309e0c6b74792) >=20 > Looking at commit 7f198321eec0f520373, I see positive changes like in=20 > ArmCrashDumpDxe.c spacing in the ASSERT calls and treatment of=20 > multi-line parameter formatting in the mCpu->RegisterInterruptHandler()= =20 > call are consistent. >=20 > That carries on for a number of C calls with inconsistent spacing before= =20 > opening parentheses and calls such as those to the DEBUG macro which I=20 > find easier to read separating each parameter on a dedicated line. >=20 > In AArch64Mmu.h, I agree that preserving the (mostly) global column as=20 > opposed to block-specific columns would be easier to vertically scan. Is= =20 > that the main issue in the file? >=20 >> - it forces indentation-only changes to code in the vicinity of actual >> =C2=A0=C2=A0 changes, making the code history more bloated than necessar= y (see >> =C2=A0=C2=A0 commit 7f198321eec0f520373 for an example) >=20 >> - finding out from the web UI what exactly Uncrustify objected to is not >> =C2=A0=C2=A0 straight-forward. >> >> So let's enable AuditMode for ArmPkg, so that interested parties can see >> the uncrustify recommendations if desired, but without preventing the >> changes from being merged. This leaves it at the discretion of the >> ArmPkg maintainers to decide which level of conformance is required. >> >> Cc: Leif Lindholm >> Cc: "Kinney, Michael D" >> Cc: Michael Kubacki >> Signed-off-by: Ard Biesheuvel >> --- >> =C2=A0 ArmPkg/ArmPkg.ci.yaml | 5 +++++ >> =C2=A0 1 file changed, 5 insertions(+) >> >> diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml >> index 24db7425051388cf..d3124816118944cb 100644 >> --- a/ArmPkg/ArmPkg.ci.yaml >> +++ b/ArmPkg/ArmPkg.ci.yaml >> @@ -239,5 +239,10 @@ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ], >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "AdditionalInclud= ePaths": [] # Additional paths to spell check >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 # (wildcards supported) >> >> +=C2=A0=C2=A0=C2=A0 }, >> >> + >> >> +=C2=A0=C2=A0=C2=A0 # options defined in .pytool/Plugin/UncrustifyCheck >> >> +=C2=A0=C2=A0=C2=A0 "UncrustifyCheck": { >> >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "AuditOnly": True >> >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> >> =C2=A0 } >> >=20 >=20 >=20 >=20