xref: /aosp_15_r20/external/pigweed/third_party/fuchsia/repo/.clang-format (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
2BasedOnStyle: Google
3# This defaults to 'Auto'. Explicitly set it for a while, so that
4# 'vector<vector<int> >' in existing files gets formatted to
5# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
6# 'int>>' if the file already contains at least one such instance.)
7Standard: Cpp11
8SortIncludes: true
9AllowShortIfStatementsOnASingleLine: false
10AllowShortLoopsOnASingleLine: false
11BreakStringLiterals: false
12DerivePointerAlignment: true
13PointerAlignment: Left
14ColumnLimit: 100
15ForEachMacros: ['list_for_every_entry','list_for_every_entry_safe']
16IncludeBlocks: Regroup
17IncludeCategories:
18  # This specific header must come last in kernel source files.  Its
19  # matching rule must come first so the lower-priority rules don't match.
20  - Regex:           '^<ktl/enforce\.h>'
21    Priority:        1000
22  # C Header: <foo.h>, <net/foo.h>, etc
23  - Regex:           '^(<((zircon/|lib/|fuchsia/|arpa/|net/|netinet/|sys/|fidl/)[a-zA-Z0-9_/\.-]+\.h|[a-zA-Z0-9_-]+\.h)>)'
24    Priority:        1
25  # Cpp Header: <foo> and <experimental/foo>
26  - Regex:           '^(<(experimental/)*[a-zA-Z0-9_-]+>)'
27    Priority:        2
28  # Libraries: <foo/bar.h>
29  - Regex:           '^(<[a-zA-Z0-9_/-]+\.h>)'
30    Priority:        3
31  # Local headers: "foo/bar.h"
32  - Regex:           '^("[.a-zA-Z0-9_/-]+\.h")'
33    Priority:        4
34