[edk2-devel] [PATCH v1 2/7] .pytool: Add cpp support to uncrustify plugin

VivianNK posted 7 patches 2 years, 6 months ago
There is a newer version of this series
[edk2-devel] [PATCH v1 2/7] .pytool: Add cpp support to uncrustify plugin
Posted by VivianNK 2 years, 6 months ago
Modified the uncrustify config to apply cpp specific formatting rules.
Modified uncrustify check to include *.cpp files.

CC: Sean Brogan <sean.brogan@microsoft.com> 
CC: Michael Kubacki <mikuback@linux.microsoft.com> 
CC: Michael D Kinney <michael.d.kinney@intel.com> 
CC: Liming Gao <gaoliming@byosoft.com.cn> 
Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com>
---
 .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 2 +-
 .pytool/Plugin/UncrustifyCheck/uncrustify.cfg     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
index 8978ffc443bf..17f77b48d954 100644
--- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
+++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
@@ -110,7 +110,7 @@ class UncrustifyCheck(ICiBuildPlugin):
     # A package can add any additional paths with "AdditionalIncludePaths"
     # A package can remove any of these paths with "IgnoreStandardPaths"
     #
-    STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h")
+    STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h", "*.cpp")
 
     #
     # The Uncrustify application path should set in this environment variable
diff --git a/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg b/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg
index 8506c3333715..d7e86a6e57e6 100644
--- a/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg
+++ b/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg
@@ -215,7 +215,7 @@ indent_braces                   = false
 indent_braces_no_class          = false
 indent_braces_no_func           = true
 indent_braces_no_struct         = false
-indent_class                    = false
+indent_class                    = true
 indent_class_colon              = false
 indent_cmt_with_tabs            = false         # Whether to indent comments that are not at a brace level with tabs on
                                                 # a tabstop. Requires indent_with_tabs=2. If false, will use spaces.
@@ -223,7 +223,7 @@ indent_col1_comment             = true
 indent_col1_multi_string_literal= true
 indent_comma_paren              = true
 indent_else_if                  = true
-indent_extern                   = false
+indent_extern                   = true
 indent_first_bool_expr          = true
 
 indent_func_def_param_paren_pos_threshold = 0
-- 
2.41.0.windows.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107666): https://edk2.groups.io/g/devel/message/107666
Mute This Topic: https://groups.io/mt/100655289/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 2/7] .pytool: Add cpp support to uncrustify plugin
Posted by Michael Kubacki 2 years, 5 months ago
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

On 8/9/2023 5:32 PM, VivianNK wrote:
> Modified the uncrustify config to apply cpp specific formatting rules.
> Modified uncrustify check to include *.cpp files.
> 
> CC: Sean Brogan <sean.brogan@microsoft.com>
> CC: Michael Kubacki <mikuback@linux.microsoft.com>
> CC: Michael D Kinney <michael.d.kinney@intel.com>
> CC: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com>
> ---
>   .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 2 +-
>   .pytool/Plugin/UncrustifyCheck/uncrustify.cfg     | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
> index 8978ffc443bf..17f77b48d954 100644
> --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
> +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
> @@ -110,7 +110,7 @@ class UncrustifyCheck(ICiBuildPlugin):
>       # A package can add any additional paths with "AdditionalIncludePaths"
> 
>       # A package can remove any of these paths with "IgnoreStandardPaths"
> 
>       #
> 
> -    STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h")
> 
> +    STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h", "*.cpp")
> 
>   
> 
>       #
> 
>       # The Uncrustify application path should set in this environment variable
> 
> diff --git a/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg b/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg
> index 8506c3333715..d7e86a6e57e6 100644
> --- a/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg
> +++ b/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg
> @@ -215,7 +215,7 @@ indent_braces                   = false
>   indent_braces_no_class          = false
> 
>   indent_braces_no_func           = true
> 
>   indent_braces_no_struct         = false
> 
> -indent_class                    = false
> 
> +indent_class                    = true
> 
>   indent_class_colon              = false
> 
>   indent_cmt_with_tabs            = false         # Whether to indent comments that are not at a brace level with tabs on
> 
>                                                   # a tabstop. Requires indent_with_tabs=2. If false, will use spaces.
> 
> @@ -223,7 +223,7 @@ indent_col1_comment             = true
>   indent_col1_multi_string_literal= true
> 
>   indent_comma_paren              = true
> 
>   indent_else_if                  = true
> 
> -indent_extern                   = false
> 
> +indent_extern                   = true
> 
>   indent_first_bool_expr          = true
> 
>   
> 
>   indent_func_def_param_paren_pos_threshold = 0
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107754): https://edk2.groups.io/g/devel/message/107754
Mute This Topic: https://groups.io/mt/100655289/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-