THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

clang-format: use git grep to generate the ForEachMacros list

The ForEachMacros list can reasonably be generated grepping
the C source code for macros with 'for_each' in their name.

Taken almost verbatim from the .clang-format file in the Linux kernel.

Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tags/v2.23.0-rc0
Miguel Ojeda Junio C Hamano 5 months ago
parent
commit
fc7e03aace
1 changed files with 15 additions and 2 deletions
  1. +15
    -2
      .clang-format

+ 15
- 2
.clang-format View File

@@ -148,8 +148,21 @@ SpacesInSquareBrackets: false
Cpp11BracedListStyle: false

# A list of macros that should be interpreted as foreach loops instead of as
# function calls.
ForEachMacros: ['for_each_string_list_item', 'for_each_wanted_builtin', 'for_each_builtin', 'for_each_ut']
# function calls. Taken from:
# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' \
# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
# | sort | uniq
ForEachMacros:
- 'for_each_abbrev'
- 'for_each_builtin'
- 'for_each_string_list_item'
- 'for_each_ut'
- 'for_each_wanted_builtin'
- 'list_for_each'
- 'list_for_each_dir'
- 'list_for_each_prev'
- 'list_for_each_prev_safe'
- 'list_for_each_safe'

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


Loading…
Cancel
Save