public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
@ 2022-02-10 16:19 Michael Kubacki
  2022-02-10 16:44 ` Michael D Kinney
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michael Kubacki @ 2022-02-10 16:19 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

From: Michael Kubacki <michael.kubacki@microsoft.com>

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 <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 .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:
         """
-- 
2.28.0.windows.1


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

* Re: [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-02-10 16:19 [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default Michael Kubacki
@ 2022-02-10 16:44 ` Michael D Kinney
  2022-02-10 16:47 ` [edk2-devel] " Rebecca Cran
  2022-02-23 17:48 ` Rebecca Cran
  2 siblings, 0 replies; 8+ messages in thread
From: Michael D Kinney @ 2022-02-10 16:44 UTC (permalink / raw)
  To: mikuback@linux.microsoft.com, devel@edk2.groups.io,
	Kinney, Michael D
  Cc: Gao, Liming, Sean Brogan, Bret Barkelew

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

> -----Original Message-----
> From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
> Sent: Thursday, February 10, 2022 8:19 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Sean Brogan
> <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
> Subject: [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
> 
> From: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> 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 <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
>  .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:
>          """
> --
> 2.28.0.windows.1


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

* Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-02-10 16:19 [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default Michael Kubacki
  2022-02-10 16:44 ` Michael D Kinney
@ 2022-02-10 16:47 ` Rebecca Cran
  2022-02-23 17:48 ` Rebecca Cran
  2 siblings, 0 replies; 8+ messages in thread
From: Rebecca Cran @ 2022-02-10 16:47 UTC (permalink / raw)
  To: devel, mikuback; +Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

Thanks!


Reviewed-by: Rebecca Cran <quic_rcran@quicinc.com>


-- 

Rebecca Cran


On 2/10/22 09:19, Michael Kubacki wrote:
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> 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 <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
>   .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:
>           """

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

* Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-02-10 16:19 [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default Michael Kubacki
  2022-02-10 16:44 ` Michael D Kinney
  2022-02-10 16:47 ` [edk2-devel] " Rebecca Cran
@ 2022-02-23 17:48 ` Rebecca Cran
  2022-02-25 21:18   ` Michael Kubacki
  2 siblings, 1 reply; 8+ messages in thread
From: Rebecca Cran @ 2022-02-23 17:48 UTC (permalink / raw)
  To: devel, mikuback; +Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

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<michael.kubacki@microsoft.com>
>
> 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<michael.d.kinney@intel.com>
> Cc: Liming Gao<gaoliming@byosoft.com.cn>
> Cc: Sean Brogan<sean.brogan@microsoft.com>
> Cc: Bret Barkelew<Bret.Barkelew@microsoft.com>
> Signed-off-by: Michael Kubacki<michael.kubacki@microsoft.com>
> ---
>   .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:
>           """

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

* Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-02-23 17:48 ` Rebecca Cran
@ 2022-02-25 21:18   ` Michael Kubacki
  2022-04-05 14:31     ` Rebecca Cran
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Kubacki @ 2022-02-25 21:18 UTC (permalink / raw)
  To: Rebecca Cran, devel
  Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

Hi Rebecca,

Sorry for the delay, I was out of office.

The diff will appear in <Workspace>/Build/TestSuites.xml. Here, I have 
intentionally introduced an error in 
UnitTestFrameworkPkg\Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c:

  Uncrustify executed against 21 files in UnitTestFrameworkPkg in 0.19 
seconds.
  </system-out><system-err>Files with formatting errors:
  Formatting errors in Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c
  --- 
D:\src\edk2\UnitTestFrameworkPkg\Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c
  +++ 
D:\src\edk2\UnitTestFrameworkPkg\Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c.uncrustify_plugin
  @@ -13,7 +13,7 @@
  #include &lt;Library/UnitTestLib.h&gt;
  #include &lt;Library/PrintLib.h&gt;

  -#define UNIT_TEST_NAME        "Sample Unit Test"
  +#define UNIT_TEST_NAME     "Sample Unit Test"
  #define UNIT_TEST_VERSION  "0.1"

  ///

  </system-err></testcase></testsuite></testsuites>

Thanks,
Michael

On 2/23/2022 12:48 PM, Rebecca Cran wrote:
> 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?
> 
> 

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

* Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-02-25 21:18   ` Michael Kubacki
@ 2022-04-05 14:31     ` Rebecca Cran
  2022-04-05 14:46       ` Michael Kubacki
  0 siblings, 1 reply; 8+ messages in thread
From: Rebecca Cran @ 2022-04-05 14:31 UTC (permalink / raw)
  To: Michael Kubacki, devel
  Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

So your change in 56530dec1105f17455752675e4c90fb859c64836 didn't fix 
anything, because we don't output TestSuites.xml to the console: if I 
introduce a code style issue into a branch, CI still only prints the 
following:

PROGRESS - --Running ArmPkg: Uncrustify Coding Standard Test NO-TARGET --
WARNING - A file header template is not specified in the config file.
WARNING - A function header template is not specified in the config file.
ERROR - /home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c
ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
returned 1
ERROR - Overall Build Status: Error
PROGRESS - There were 1 failures out of 13 attempts


Could we get the diff printed *there* too?

-- 
Rebecca Cran


On 2/25/22 14:18, Michael Kubacki wrote:
> Hi Rebecca,
>
> Sorry for the delay, I was out of office.
>
> The diff will appear in <Workspace>/Build/TestSuites.xml. Here, I have 
> intentionally introduced an error in 
> UnitTestFrameworkPkg\Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c:
>
>  Uncrustify executed against 21 files in UnitTestFrameworkPkg in 0.19 
> seconds.
>  </system-out><system-err>Files with formatting errors:
>  Formatting errors in 
> Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c
>  --- 
> D:\src\edk2\UnitTestFrameworkPkg\Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c
>  +++ 
> D:\src\edk2\UnitTestFrameworkPkg\Test\UnitTest\Sample\SampleUnitTest\SampleUnitTest.c.uncrustify_plugin
>  @@ -13,7 +13,7 @@
>  #include &lt;Library/UnitTestLib.h&gt;
>  #include &lt;Library/PrintLib.h&gt;
>
>  -#define UNIT_TEST_NAME        "Sample Unit Test"
>  +#define UNIT_TEST_NAME     "Sample Unit Test"
>  #define UNIT_TEST_VERSION  "0.1"
>
>  ///
>
>  </system-err></testcase></testsuite></testsuites>
>
> Thanks,
> Michael
>
> On 2/23/2022 12:48 PM, Rebecca Cran wrote:
>> 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?
>>
>>


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

* Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-04-05 14:31     ` Rebecca Cran
@ 2022-04-05 14:46       ` Michael Kubacki
  2022-04-05 14:52         ` Rebecca Cran
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Kubacki @ 2022-04-05 14:46 UTC (permalink / raw)
  To: Rebecca Cran, devel
  Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

It is printed in the error log. For your current PR:
https://github.com/tianocore/edk2/pull/2744

The results are printed in "Standard_Error_Output.log":
https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47584&view=ms.vss-test-web.build-test-results-tab&runId=346168&resultId=100012&paneView=attachments

These are the results:

"""
Files with formatting errors:
  Formatting errors in Library/ArmSmcLib/ArmSmc.c
  --- /home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c
  +++ 
/home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c.uncrustify_plugin
  @@ -25,10 +25,10 @@
  IN OUT UINTN  *Arg1 OPTIONAL,
  IN OUT UINTN  *Arg2 OPTIONAL,
  IN OUT UINTN  *Arg3 OPTIONAL
  -)
  +  )
  {
  ARM_SMC_ARGS  Args;
  -  UINTN    ErrorCode;
  +  UINTN         ErrorCode;

  ZeroMem (&Args, sizeof (ARM_SMC_ARGS));

  @@ -80,7 +80,7 @@
  IN     UINTN  Function,
  IN OUT UINTN  *Arg1 OPTIONAL,
  IN OUT UINTN  *Arg2 OPTIONAL,
  -  OUT UINTN *Arg3 OPTIONAL
  +  OUT UINTN     *Arg3 OPTIONAL
  )
  {
  return ArmCallSmc3 (Function, Arg1, Arg2, Arg3);
  @@ -102,7 +102,7 @@
  IN OUT UINTN  *Arg1 OPTIONAL,
  OUT UINTN     *Arg2 OPTIONAL,
  OUT UINTN     *Arg3 OPTIONAL
  -)
  +  )
  {
  return ArmCallSmc3 (Function, Arg1, Arg2, Arg3);
  }
"""

These diffs can get very verbose and will overwhelm people if printed to 
standard console output. They are cleanly separated here.

Thanks,
Michael

On 4/5/2022 10:31 AM, Rebecca Cran wrote:
> So your change in 56530dec1105f17455752675e4c90fb859c64836 didn't fix 
> anything, because we don't output TestSuites.xml to the console: if I 
> introduce a code style issue into a branch, CI still only prints the 
> following:
> 
> PROGRESS - --Running ArmPkg: Uncrustify Coding Standard Test NO-TARGET --
> WARNING - A file header template is not specified in the config file.
> WARNING - A function header template is not specified in the config file.
> ERROR - /home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c
> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
> returned 1
> ERROR - Overall Build Status: Error
> PROGRESS - There were 1 failures out of 13 attempts
> 
> 
> Could we get the diff printed *there* too?
> 

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

* Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default
  2022-04-05 14:46       ` Michael Kubacki
@ 2022-04-05 14:52         ` Rebecca Cran
  0 siblings, 0 replies; 8+ messages in thread
From: Rebecca Cran @ 2022-04-05 14:52 UTC (permalink / raw)
  To: Michael Kubacki, devel
  Cc: Michael D Kinney, Liming Gao, Sean Brogan, Bret Barkelew

Thanks. I hadn't come across that view before.

-- 
Rebecca Cran

On 4/5/22 08:46, Michael Kubacki wrote:
> It is printed in the error log. For your current PR:
> https://github.com/tianocore/edk2/pull/2744
>
> The results are printed in "Standard_Error_Output.log":
> https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=47584&view=ms.vss-test-web.build-test-results-tab&runId=346168&resultId=100012&paneView=attachments 
>
>
> These are the results:
>
> """
> Files with formatting errors:
>  Formatting errors in Library/ArmSmcLib/ArmSmc.c
>  --- /home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c
>  +++ 
> /home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c.uncrustify_plugin
>  @@ -25,10 +25,10 @@
>  IN OUT UINTN  *Arg1 OPTIONAL,
>  IN OUT UINTN  *Arg2 OPTIONAL,
>  IN OUT UINTN  *Arg3 OPTIONAL
>  -)
>  +  )
>  {
>  ARM_SMC_ARGS  Args;
>  -  UINTN    ErrorCode;
>  +  UINTN         ErrorCode;
>
>  ZeroMem (&Args, sizeof (ARM_SMC_ARGS));
>
>  @@ -80,7 +80,7 @@
>  IN     UINTN  Function,
>  IN OUT UINTN  *Arg1 OPTIONAL,
>  IN OUT UINTN  *Arg2 OPTIONAL,
>  -  OUT UINTN *Arg3 OPTIONAL
>  +  OUT UINTN     *Arg3 OPTIONAL
>  )
>  {
>  return ArmCallSmc3 (Function, Arg1, Arg2, Arg3);
>  @@ -102,7 +102,7 @@
>  IN OUT UINTN  *Arg1 OPTIONAL,
>  OUT UINTN     *Arg2 OPTIONAL,
>  OUT UINTN     *Arg3 OPTIONAL
>  -)
>  +  )
>  {
>  return ArmCallSmc3 (Function, Arg1, Arg2, Arg3);
>  }
> """
>
> These diffs can get very verbose and will overwhelm people if printed 
> to standard console output. They are cleanly separated here.
>
> Thanks,
> Michael
>
> On 4/5/2022 10:31 AM, Rebecca Cran wrote:
>> So your change in 56530dec1105f17455752675e4c90fb859c64836 didn't fix 
>> anything, because we don't output TestSuites.xml to the console: if I 
>> introduce a code style issue into a branch, CI still only prints the 
>> following:
>>
>> PROGRESS - --Running ArmPkg: Uncrustify Coding Standard Test 
>> NO-TARGET --
>> WARNING - A file header template is not specified in the config file.
>> WARNING - A function header template is not specified in the config 
>> file.
>> ERROR - /home/vsts/work/1/s/ArmPkg/Library/ArmSmcLib/ArmSmc.c
>> ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET 
>> returned 1
>> ERROR - Overall Build Status: Error
>> PROGRESS - There were 1 failures out of 13 attempts
>>
>>
>> Could we get the diff printed *there* too?
>>


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

end of thread, other threads:[~2022-04-05 14:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-10 16:19 [PATCH v1 1/1] .pytool/Plugin/UncrustifyCheck: Output file diffs by default Michael Kubacki
2022-02-10 16:44 ` Michael D Kinney
2022-02-10 16:47 ` [edk2-devel] " Rebecca Cran
2022-02-23 17:48 ` Rebecca Cran
2022-02-25 21:18   ` Michael Kubacki
2022-04-05 14:31     ` Rebecca Cran
2022-04-05 14:46       ` Michael Kubacki
2022-04-05 14:52         ` Rebecca Cran

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