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.25.1668449131006359590 for ; Mon, 14 Nov 2022 10:05:31 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=ozDoZxvf; 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 F309B20B717A; Mon, 14 Nov 2022 10:05:29 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F309B20B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1668449130; bh=MiGDkszhyTmpOZyUJ/nOOlC+8BaUXzjJixDRkQqB5fE=; h=Date:Subject:From:To:Reply-To:References:In-Reply-To:From; b=ozDoZxvfloF8EG0mFUJQi4hu2ReXCSdGcS3S37pZ7OTzLrPE2YSnXq4oKpH05SpkY ZC37sQZQ1aXbE8/hFZWdL/HgMWH1jO8FiysC9sNI//AfSxmO/oeSdGuDL1LanRFJpi JLrGfsJfLV1WBRy/rVXDPU10T+n9bKfqD3aKsJuo= Message-ID: Date: Mon, 14 Nov 2022 13:05:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed arguments From: "Michael Kubacki" To: devel@edk2.groups.io, michael.d.kinney@intel.com, "abner.chang@amd.com" , Laszlo Ersek , "Kubacki, Michael" Reply-To: devel@edk2.groups.io, mikuback@linux.microsoft.com References: <922996c2-e60a-80ec-6d4a-8b2e5a639c9b@redhat.com> <25893.1668303336748921539@groups.io> <17278424C4A5D78F.32003@groups.io> In-Reply-To: <17278424C4A5D78F.32003@groups.io> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Have these changes been discussed in a community forum? Do you think we=20 could talk about it in the Tianocore Tools & CI Meeting today? Thanks, Michael On 11/14/2022 12:37 PM, Michael Kubacki wrote: > I'm catching up on this thread so let me know if I miss something. >=20 > Uncrustify can perform conversions/enforcements like adjusting code to <= =20 > 80 columns. >=20 > The edk2 uncrustify configuration file is here and you will see that I=20 > commented column width enforcement: >=20 > https://github.com/tianocore/edk2/blob/master/.pytool/Plugin/UncrustifyCh= eck/uncrustify.cfg#L19.=20 >=20 >=20 > Uncrustify aside, column width is particularly difficult to adjust=20 > consistently. Both humans and tools have to make many (constant)=20 > situational decisions based on code structure. >=20 > However, it should be possible. I've taken the current uncrustify=20 > configuration file, made minimal changes to restrict code to 80 columns,= =20 > and published the results based on the current edk2 code tree here: >=20 > https://github.com/makubacki/edk2/tree/uncrustify_80_column_change >=20 > You can see the I ran uncrustify 3 times to reach a mostly steady state.= =20 > The issue after the second run is that uncrustify is confused about what= =20 > to do with single macros that exceed 80 columns. >=20 > Examples: > 1.=20 > https://github.com/makubacki/edk2/blob/uncrustify_80_column_change/MdePkg= /Include/IndustryStandard/Acpi30.h#L702-#L704=20 >=20 > 2.=20 > https://github.com/makubacki/edk2/blob/uncrustify_80_column_change/MdePkg= /Include/IndustryStandard/IpmiNetFnApp.h#L1023-#L1031=20 >=20 >=20 > There are other cases there as well. >=20 > Anyway, if those were reduced in length, I think we could reach a steady= =20 > state. Some other minor tweaks might also be required. >=20 > Regarding function calls, I put together the following branch to=20 > demonstrate some examples of what is done now. >=20 > In summary, multiple arguments can be provided on a single line (with no= =20 > width or argument count maximum) or multiple lines. If a single argument= =20 > is multi-line, then all arguments must be on a unique line to follow the= =20 > multi-line argument convention. >=20 > See the top two commits in this branch for examples: >=20 > https://github.com/makubacki/edk2/tree/func_arg_formatting_demo >=20 > I agree uncrustify and the spec be in sync. >=20 > Regards, > Michael >=20 > On 11/14/2022 12:07 PM, Michael D Kinney wrote: >> I disagree that they can coexist. >> >> If uncrustify is forcing 1 arg per line, then a developer that follows= =20 >> a CSS that allows multiple per line, the code change will be rejected=20 >> by EDK II CI. >> >> The CSS and Uncristify behavior need to be aligned.If we want a CSS=20 >> change that requires Uncristify changes, then they have to be=20 >> coordinated. >> >> Mike >> >> *From:*devel@edk2.groups.io *On Behalf Of=20 >> *Chang, Abner via groups.io >> *Sent:* Sunday, November 13, 2022 5:10 PM >> *To:* devel@edk2.groups.io; Kinney, Michael D=20 >> ; Laszlo Ersek ;=20 >> Kubacki, Michael >> *Subject:* Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH=20 >> 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed=20 >> arguments >> >> [AMD Official Use Only - General] >> >> For this case, we don=E2=80=99t have to take another global reformatting= .=20 >> These two formats can coexisting without the conflict. =C2=A0We just all= ow=20 >> the condense argus format in CSS. Also, update Uncrustify to not=20 >> forcing each argument at its own line. >> >> The current Uncrustify behavior seems to me match the CCS spec. But=20 >> this patch was sent to allow the multiple argus at the same line,=20 >> which was not proposed to fix the issue in current Uncrustify. You=20 >> sure we just close this issue? >> >> Abner >> >> *From:* devel@edk2.groups.io =20 >> > *On Behalf Of=20 >> *Michael D Kinney via groups.io >> *Sent:* Monday, November 14, 2022 1:36 AM >> *To:* devel@edk2.groups.io ; Chang, Abner= =20 >> >; Laszlo Ersek=20 >> >; Kubacki, Michael=20 >> > >; Kinney, Michael D=20 >> > >> *Subject:* Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH=20 >> 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed=20 >> arguments >> >> >> >> *Caution:*This message originated from an External Source. Use proper=20 >> caution when opening attachments, clicking links, or responding. >> >> We do not want another global format change because that make git=20 >> blame difficult to use. >> >> Are any clarifications required to describe the current Uncrustify=20 >> behavior?=C2=A0 Or is the description correct? >> >> If the current description matches Uncristify behavior, then I=20 >> recommend we close this issue as will not fix. >> >> Mike >> >> *From:* devel@edk2.groups.io =20 >> > *On Behalf Of=20 >> *Chang, Abner via groups.io >> *Sent:* Sunday, November 13, 2022 12:45 AM >> *To:* Kinney, Michael D > >; devel@edk2.groups.io=20 >> ; Laszlo Ersek > >; Kubacki, Michael=20 >> > >> *Subject:* Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH=20 >> 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed=20 >> arguments >> >> [AMD Official Use Only - General] >> >> Uncrustify can fix the first argument that is not at the indent with=20 >> two space. It also can fix the first argument that is not at the new=20 >> line. >> >> But it also makes each argument a new line if multiple args are=20 >> condensed in one line. That is what we have to update Uncrustify if we= =20 >> have this patch merged to CCS. >> >> +Michael Kubacki in loop. >> >> Abner >> >> *From:* Kinney, Michael D > > >> *Sent:* Sunday, November 13, 2022 9:58 AM >> *To:* devel@edk2.groups.io ; Chang, Abner= =20 >> >; Laszlo Ersek=20 >> >; Kinney, Michael D=20 >> > >> *Subject:* RE: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH=20 >> 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed=20 >> arguments >> >> >> >> *Caution:*This message originated from an External Source. Use proper=20 >> caution when opening attachments, clicking links, or responding. >> >> Is this exactly what Uncrustify does now? >> >> Mike >> >> *From:* devel@edk2.groups.io =20 >> > *On Behalf Of=20 >> *Chang, Abner via groups.io >> *Sent:* Saturday, November 12, 2022 5:36 PM >> *To:* Laszlo Ersek >;=20 >> devel@edk2.groups.io >> *Subject:* Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH=20 >> 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed=20 >> arguments >> >> Hi all, >> As we are going to release CCS 2.3, we would like to address some=20 >> pending issues of CCS. For this, I think we can, >> - Still keep the one line per argument style in CCS although the=20 >> multi-arguments in the one line style can cover this. This avoids=20 >> confusion from readers and questions about if they can do the one-line= =20 >> per argument style. >> - If the arguments are in different lines, the first argument must be=20 >> indented with two spaces from the start of the function name or the=20 >> member function name. >> How is this? >> >> Abner >> >> >=20 >=20 >=20 >=20