From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by mx.groups.io with SMTP id smtpd.web11.11048.1645638524329686629 for ; Wed, 23 Feb 2022 09:48:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=mUqTmqQl; spf=pass (domain: quicinc.com, ip: 199.106.114.39, mailfrom: quic_rcran@quicinc.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1645638524; x=1677174524; h=message-id:date:mime-version:from:subject:to:cc: references:in-reply-to:content-transfer-encoding; bh=7YBDkeq9UphoWN/Gp2OAu/0eO2eC9aL7bSwSDbQYV2Y=; b=mUqTmqQlwM6i7QY3mEVeKvJWVDR1C7XTre0E91DwUUb966P8Ai+58PPS JwjkffSfFFCTKfMXB9hcPgCSFzQV8QYRDaKYcB8LMIbjHqqPG5Unz3a3z 8yRjN5MOHTh0JDl0JrUm1ZPsXVqPNbWSdRVCTgD5vhI/Djh3SuuyEghzB U=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 23 Feb 2022 09:48:43 -0800 X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 09:48:43 -0800 Received: from [10.110.101.24] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Wed, 23 Feb 2022 09:48:42 -0800 Message-ID: <7ab3cb92-85e1-c8ec-fc4e-20ae84a65c2f@quicinc.com> Date: Wed, 23 Feb 2022 10:48:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: "Rebecca Cran" Subject: Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default To: , CC: Michael D Kinney , Liming Gao , Sean Brogan , "Bret Barkelew" References: <20220210161927.1847-1-mikuback@linux.microsoft.com> In-Reply-To: <20220210161927.1847-1-mikuback@linux.microsoft.com> Return-Path: quic_rcran@quicinc.com X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) Content-Language: en-US Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit This doesn't appear to work. If I change MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c to introduce an error, then I get the following output (with verbose mode): INFO - ------------------------------------------------ INFO - --------------Cmd Output Finished--------------- INFO - --------- Running Time (mm:ss): 00:07 ---------- INFO - ----------- Return Code: 0x00000000 ------------ INFO - ------------------------------------------------ INFO - Uncrustify executed against 1035 files in MdeModulePkg in 7.67 seconds. INFO - Calculating file diffs. This might take a while... ERROR - .../edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET returned 1 PROGRESS - --Running MdeModulePkg: Spell Check Test NO-TARGET -- So it's seeing that _output_file_diffs is True, but it appears that there aren't any formatted_files? -- Rebecca Cran On 2/10/22 09:19, Michael Kubacki wrote: > From: Michael Kubacki > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3808 > > Changes the default for the "OutputFileDiffs" configuration option > to "True" so the formatting suggestions detected by Uncrustify > will be output in the test case log. The diff is printed in unified > diff format. > > This was disabled by default during the initial enabling of > Uncrustify to reduce overall execution time of the plugin against > the codebase due to the large number of changes detected. > > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Sean Brogan > Cc: Bret Barkelew > Signed-off-by: Michael Kubacki > --- > .pytool/Plugin/UncrustifyCheck/Readme.md | 4 ++-- > .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 6 +++--- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/.pytool/Plugin/UncrustifyCheck/Readme.md b/.pytool/Plugin/UncrustifyCheck/Readme.md > index bb263bcc87d7..0c46fd241a7a 100644 > --- a/.pytool/Plugin/UncrustifyCheck/Readme.md > +++ b/.pytool/Plugin/UncrustifyCheck/Readme.md > @@ -42,7 +42,7 @@ The plugin can be configured with a few optional configuration options. > "AuditOnly": False, # Don't fail the build if there are errors. Just log them. > "ConfigFilePath": "", # Custom path to an Uncrustify config file. > "IgnoreStandardPaths": [], # Standard Plugin defined paths that should be ignored. > - "OutputFileDiffs": False, # Output chunks of formatting diffs in the test case log. > + "OutputFileDiffs": True, # Output chunks of formatting diffs in the test case log. > # This can significantly slow down the plugin on very large packages. > "SkipGitExclusions": False # Don't exclude git ignored files and files in git submodules. > } > @@ -82,7 +82,7 @@ to be ignored. > > ### `OutputFileDiffs` > > -`Boolean` - Default is `False`. > +`Boolean` - Default is `True`. > > If `True`, output diffs of formatting changes into the test case log. This is helpful to exactly understand what changes > need to be made to the source code in order to fix a coding standard compliance issue. > diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > index 6db8d1739a80..ea8396942b16 100644 > --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py > @@ -494,13 +494,13 @@ class UncrustifyCheck(ICiBuildPlugin): > Initializes options that influence test case output. > """ > self._audit_only_mode = False > - self._output_file_diffs = False > + self._output_file_diffs = True > > if "AuditOnly" in self._package_config and self._package_config["AuditOnly"]: > self._audit_only_mode = True > > - if "OutputFileDiffs" in self._package_config and self._package_config["OutputFileDiffs"]: > - self._output_file_diffs = True > + if "OutputFileDiffs" in self._package_config and not self._package_config["OutputFileDiffs"]: > + self._output_file_diffs = False > > def _log_uncrustify_app_info(self) -> None: > """