clang-format: include kh_foreach* macros in ForEachMacros

The command for generating the list of ForEachMacros searches for macros whose name contains the string "for_each". Include those whose name contains "foreach" as well. That brings in kh_foreach and kh_foreach_value from khash.h. Regenerating the list also brings in hashmap-based macros added by 87571c3f71 (hashmap: use *_entry APIs for iteration, 2019-10-06), f0e63c4113 (hashmap: use *_entry APIs to wrap container_of, 2019-10-06), 4fa1d501f7 (strmap: add functions facilitating use as a string->int map, 2020-11-05), b70c82e6ed (strmap: add more utility functions, 2020-11-05), and 1201eb628a (strmap: add a strset sub-type, 2020-11-06). for_each_abbrev is no longer found because its definition was removed by d850b7a545 (cocci: apply the "cache.h" part of "the_repository.pending", 2023-03-28). Note that it had been a false positive, though, as it had been a function wrapper, not a for-like macro. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Jul 5, 2024 at 21:25 UTC 1457dff9be97955f5ef9d780cc340e4691d2818b
1 file changed +9 -4
.clang-format
+9 -4
@@ -149,20 +149,25 @@ Cpp11BracedListStyle: false
149
150 # A list of macros that should be interpreted as foreach loops instead of as
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
152 +# git grep -h '^#define [^[:space:]]*for_\?each[^[:space:]]*(' |
153 +# sed "s/^#define / - '/; s/(.*$/'/" | sort | uniq
154 ForEachMacros:
156 - - 'for_each_abbrev'
155 - 'for_each_builtin'
156 - 'for_each_string_list_item'
157 - 'for_each_ut'
158 - 'for_each_wanted_builtin'
159 + - 'hashmap_for_each_entry'
160 + - 'hashmap_for_each_entry_from'
161 + - 'kh_foreach'
162 + - 'kh_foreach_value'
163 - 'list_for_each'
164 - 'list_for_each_dir'
165 - 'list_for_each_prev'
166 - 'list_for_each_prev_safe'
167 - 'list_for_each_safe'
168 + - 'strintmap_for_each_entry'
169 + - 'strmap_for_each_entry'
170 + - 'strset_for_each_entry'
171
172 # The maximum number of consecutive empty lines to keep.
173 MaxEmptyLinesToKeep: 1