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.web10.29685.1629144041475467845 for ; Mon, 16 Aug 2021 13:00:41 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=n3ByiG03; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [10.0.0.120] (c-73-27-179-174.hsd1.fl.comcast.net [73.27.179.174]) by linux.microsoft.com (Postfix) with ESMTPSA id 35C2A20C29EA; Mon, 16 Aug 2021 13:00:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 35C2A20C29EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1629144040; bh=L/RRWhfGo7d7zu2tFFKD1OIhmI4mFTsG5b9xRFFbLJU=; h=Subject:To:References:From:Date:In-Reply-To:From; b=n3ByiG03VySgbKwUh6QdQvKbJYdgr56+EpLRDUfJ+pRSMKKodaaeiC+6BnWsGyyfs s/b3ml5C2xQCO2jOMxb3B8IQhFDlVbV9vRHxq0AfAtVaQjs0IfG4IwE4eWOQ3zFd1n o8s/YxHKqfQnDN4SbMOKcA87/b2YNge+g2bfdH+Q= Subject: Re: [edk2-devel] Progress on getting Uncrustify working for EDK2? To: devel@edk2.groups.io, mhaeuser@posteo.de, rebecca@nuviainc.com, Michael Kubacki , Bret Barkelew , Michael D Kinney References: <07a6ecff-f7bf-083a-f24d-246ca6c7988b@nuviainc.com> <2679bfa3-b4ec-d8e9-7e56-54ebe42d9001@posteo.de> From: "Michael Kubacki" Message-ID: <9fe0f984-db9d-9aec-0b44-5d30791a2855@linux.microsoft.com> Date: Mon, 16 Aug 2021 16:00:38 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <2679bfa3-b4ec-d8e9-7e56-54ebe42d9001@posteo.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable The edk2 branch was created here:=20 https://github.com/makubacki/edk2/tree/uncrustify_poc_2 We have a Project Mu fork with custom changes to the Uncrustify tool to=20 help comply with EDK II formatting here:=20 https://dev.azure.com/projectmu/_git/Uncrustify The latest information about the status and how to experiment with the=20 configuration file and the tool are in that fork:=20 https://dev.azure.com/projectmu/Uncrustify/_wiki/wikis/Uncrustify.wiki/1/Pr= oject-Mu-(EDK-II)-Fork-Readme That said, I have also finished a CI plugin to run Uncrustify that=20 should be ready soon to initially deploy in Project Mu. Before doing so,=20 I am trying to settle on an initial configuration file that less=20 strictly but more reliably formats the code than in the examples in=20 those branches. For example, remove heuristics that when run against the=20 same set of code multiple times can produce different results. An=20 example would be a rule that reformats code because it exceeds a=20 specified column width on one run but on the next run that reformatted=20 code triggers a different rule to further align the code and so on. At=20 least initially, some rules might be tweaked in a more conservative=20 approach that can be tightened in the future. Once this configuration=20 file is ready, we will baseline Project Mu code as an example and turn=20 on the plugin. The CI plugin runs Uncrustify against modified files and=20 if there's any changes, indicating a formatting deviation, the diff=20 chunks are saved in a log so they can be viewed as a build artifact. I am making progress on the updated config file and I should be able to=20 post a "uncrustify_poc_3" branch soon with the results. Regarding indentation, Marvin is right that Uncrustify cannot support=20 edk2 indentation style out-of-box. Some changes are made in that fork to=20 handle the formatting. At this point, it can handle the indentation in=20 the cases I've seen. Uncrustify does potentially give us the ability to=20 massively deploy changes across the codebase in case a decision were=20 made to change the style. Thanks, Michael On 8/16/2021 3:39 PM, Marvin H=C3=A4user wrote: > Hey Rebecca, > > I think even Uncrustify has issues with the EDK II indentation style.=20 > You might want to check the UEFI Talkbox Discord server, I had a brief=20 > chat with Michael about it there. I don't think realistically any tool=20 > supports EDK II's indentation style however, so I'd propose it is=20 > changed. This could be for new submissions only, or actually the=20 > entire codebase could be reformatted at once with a good tool setup.=20 > While this screws with git blame, the (to my understanding) decided on=20 > CRLF -> LF change does that anyway, so at least two evils could be=20 > dealt with in one go really. > > Best regards, > Marvin > > On 16/08/2021 21:34, Rebecca Cran wrote: >> >> cc devel@ . >> >> On 8/16/21 1:33 PM, Rebecca Cran wrote: >>> >>> I noticed a message on Twitter about an idea of using Uncrustify for=20 >>> EDK2 instead of the ECC tool, and came across=20 >>> https://www.mail-archive.com/search?l=3Ddevel@edk2.groups.io&q=3Dsubjec= t:%22Re%5C%3A+%5C%5Bedk2%5C-devel%5C%5D+TianoCore+Community+Meeting+Minutes= +%5C-+2%5C%2F4%22&o=3Dnewest&f=3D1=20 >>> . >>> >>> I was wondering if there's been any progress on it that I could=20 >>> check out? >>> >>> >>> Michael Kubacki: in that message, you said: >>> >>> "I'm planning to put up a branch that we can use as a reference for=20 >>> a conversation around uncrustify in the next couple of weeks." >>> >>> >>> Did you end up creating that branch, and if so could you provide a=20 >>> link to it please? >>> >>> >>> --=20 >>> Rebecca Cran >>> >> > > > >=20 >