Skip to content

Commit ee3066b

Browse files
committed
Merge branch 'mo/clang-format-for-each-update' into next
The list of for-each like macros used by clang-format has been updated. * mo/clang-format-for-each-update: clang-format: use git grep to generate the ForEachMacros list
2 parents b187c3d + fc7e03a commit ee3066b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.clang-format

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,21 @@ SpacesInSquareBrackets: false
148148
Cpp11BracedListStyle: false
149149

150150
# A list of macros that should be interpreted as foreach loops instead of as
151-
# function calls.
152-
ForEachMacros: ['for_each_string_list_item', 'for_each_wanted_builtin', 'for_each_builtin', 'for_each_ut']
151+
# function calls. Taken from:
152+
# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' \
153+
# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
154+
# | sort | uniq
155+
ForEachMacros:
156+
- 'for_each_abbrev'
157+
- 'for_each_builtin'
158+
- 'for_each_string_list_item'
159+
- 'for_each_ut'
160+
- 'for_each_wanted_builtin'
161+
- 'list_for_each'
162+
- 'list_for_each_dir'
163+
- 'list_for_each_prev'
164+
- 'list_for_each_prev_safe'
165+
- 'list_for_each_safe'
153166

154167
# The maximum number of consecutive empty lines to keep.
155168
MaxEmptyLinesToKeep: 1

0 commit comments

Comments
 (0)