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/8b6b252b-47a6-9d52-f0bd-10d3bc4ad244@digikod.net [2] Link: https://lore.kernel.org/lkml/YmHuZjmP9MxkgJ0R@google.com/ [3] Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Tom Rix <trix@redhat.com> Signed-off-by: Brian Norris <briannorris@chromium.org> Co-developed-by: Mickaël Salaün <mic@digikod.net> Signed-off-by: Mickaël Salaün <mic@digikod.net> Link: https://lore.kernel.org/r/20220506160106.522341-6-mic@digikod.net [Adjusted authorship as agreed] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent d7f6604 commit 781121a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.clang-format

Lines changed: 2 additions & 2 deletions
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)