Skip to content

Commit 781121a

Browse files
computersforpeaceojeda
authored andcommitted
clang-format: Fix space after for_each macros
Set SpaceBeforeParens to ControlStatementsExceptForEachMacros to not add space between a for_each macro and the following parenthesis. This option is available since clang-format-11 [1] and is in line with the checkpatch.pl rules [2]. I found that this patch has also been sent by Brian Norris some weeks ago [3]. Link: https://clang.llvm.org/docs/ClangFormatStyleOptions.html [1] Link: https://lore.kernel.org/r/[email protected] [2] Link: https://lore.kernel.org/lkml/[email protected]/ [3] Cc: Miguel Ojeda <[email protected]> Cc: Tom Rix <[email protected]> Signed-off-by: Brian Norris <[email protected]> Co-developed-by: Mickaël Salaün <[email protected]> Signed-off-by: Mickaël Salaün <[email protected]> Link: https://lore.kernel.org/r/[email protected] [Adjusted authorship as agreed] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent d7f6604 commit 781121a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.clang-format

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
#
3-
# clang-format configuration file. Intended for clang-format >= 10.
3+
# clang-format configuration file. Intended for clang-format >= 11.
44
#
55
# For more information, see:
66
#
@@ -667,7 +667,7 @@ SpaceAfterTemplateKeyword: true
667667
SpaceBeforeAssignmentOperators: true
668668
SpaceBeforeCtorInitializerColon: true
669669
SpaceBeforeInheritanceColon: true
670-
SpaceBeforeParens: ControlStatements
670+
SpaceBeforeParens: ControlStatementsExceptForEachMacros
671671
SpaceBeforeRangeBasedForLoopColon: true
672672
SpaceInEmptyParentheses: false
673673
SpacesBeforeTrailingComments: 1

0 commit comments

Comments
 (0)