diff mbox series

[4/8] clang-format: replace deprecated option with 'SpacesInParens'

Message ID 20240708092317.267915-5-karthik.188@gmail.com (mailing list archive)
State Superseded
Headers show
Series clang-format: add more rules and enable on CI | expand

Commit Message

karthik nayak July 8, 2024, 9:23 a.m. UTC
Replace the deprecated options 'SpacesInParentheses' and
'SpaceInEmptyParentheses' with the newer 'SpacesInParens' option. The
usage is the same.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 .clang-format | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Junio C Hamano July 8, 2024, 4:32 p.m. UTC | #1
Karthik Nayak <karthik.188@gmail.com> writes:

> Replace the deprecated options 'SpacesInParentheses' and
> 'SpaceInEmptyParentheses' with the newer 'SpacesInParens' option. The
> usage is the same.

I do not follow clang and clang-format development; updating to
avoid deprecated features is a welcome change, as long as the
replacing feature isn't too new (like, "introduced only 3 years
ago").

Thanks.

> Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
> ---
>  .clang-format | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/.clang-format b/.clang-format
> index 4c9751a9db..914254a29b 100644
> --- a/.clang-format
> +++ b/.clang-format
> @@ -134,8 +134,6 @@ SpaceBeforeAssignmentOperators: true
>  # }
>  SpaceBeforeParens: ControlStatements
>  
> -# Don't insert spaces inside empty '()'
> -SpaceInEmptyParentheses: false
>  
>  # The number of spaces before trailing line comments (// - comments).
>  # This does not affect trailing block comments (/* - comments).
> @@ -149,9 +147,10 @@ SpacesInCStyleCastParentheses: false
>  # var arr = [1, 2, 3];    not    var arr = [ 1, 2, 3 ];
>  SpacesInContainerLiterals: false
>  
> -# Don't insert spaces after '(' or before ')'
> -# f(arg);    not    f( arg );
> -SpacesInParentheses: false
> +SpacesInParens: Custom
> +SpacesInParensOptions:
> +  # Don't insert spaces inside empty '()'
> +  InEmptyParentheses: false
>  
>  # Don't insert spaces after '[' or before ']'
>  # int a[5];    not    int a[ 5 ];
diff mbox series

Patch

diff --git a/.clang-format b/.clang-format
index 4c9751a9db..914254a29b 100644
--- a/.clang-format
+++ b/.clang-format
@@ -134,8 +134,6 @@  SpaceBeforeAssignmentOperators: true
 # }
 SpaceBeforeParens: ControlStatements
 
-# Don't insert spaces inside empty '()'
-SpaceInEmptyParentheses: false
 
 # The number of spaces before trailing line comments (// - comments).
 # This does not affect trailing block comments (/* - comments).
@@ -149,9 +147,10 @@  SpacesInCStyleCastParentheses: false
 # var arr = [1, 2, 3];    not    var arr = [ 1, 2, 3 ];
 SpacesInContainerLiterals: false
 
-# Don't insert spaces after '(' or before ')'
-# f(arg);    not    f( arg );
-SpacesInParentheses: false
+SpacesInParens: Custom
+SpacesInParensOptions:
+  # Don't insert spaces inside empty '()'
+  InEmptyParentheses: false
 
 # Don't insert spaces after '[' or before ']'
 # int a[5];    not    int a[ 5 ];