Skip to content

Commit

Permalink
clang-format: Fix space after for_each macros
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
computersforpeace authored and ojeda committed May 20, 2022
1 parent d7f6604 commit 781121a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
#
# clang-format configuration file. Intended for clang-format >= 10.
# clang-format configuration file. Intended for clang-format >= 11.
#
# For more information, see:
#
Expand Down Expand Up @@ -667,7 +667,7 @@ SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
Expand Down

0 comments on commit 781121a

Please sign in to comment.