Apply Android framework header inclusion order
- Android framework header order is 1) local header and 2) system header.
- This CL further divide system headers into 2-1) Android system header
and 2-2) C++ standard header.
Bug: 168720830
Test: manual test
Change-Id: I188ca201f2d9532d02b03e26fb1c12a34859ec77
diff --git a/.clang-format b/.clang-format
index 82e72e7..fd72b1d 100644
--- a/.clang-format
+++ b/.clang-format
@@ -17,11 +17,25 @@
ContinuationIndentWidth: 8
ConstructorInitializerIndentWidth: 6
SpacesBeforeTrailingComments: 2
-IncludeBlocks: Preserve
DerivePointerAlignment: false
PointerAlignment: Left
UseTab: Never
BreakInheritanceList: AfterColon
BreakConstructorInitializers: AfterColon
PenaltyBreakBeforeFirstCallParameter: 100000
+IncludeBlocks: Regroup
+IncludeCategories:
+ - Regex: '^<[[:alnum:]_]+\.h>'
+ Priority: 3
+ SortPriority: 3
+ - Regex: '^<sys/(auxv|cachectl|capability|cdefs|endian|epoll|errno|eventfd|fcntl|file|fsuid|ifunc|inotify|ioctl|ipc|klog|limits|mman|mount|msg|mtio|param|personality|poll|prctl|procfs|ptrace|queue|quota|random|reboot|reg|resource|select|sem|sendfile|shm|signalfd|signal|socket|statfs|stat|statvfs|swap|syscall|sysconf|sysinfo|syslog|sysmacros|_system_properties|system_properties|thread_properties|time|timerfd|times|timex|ttydefaults|types|ucontext|uio|un|unistd|user|utsname|vfs|vt|wait|xattr)\.h>'
+ Priority: 3
+ SortPriority: 3
+ - Regex: '^<[[:alnum:]_]+>'
+ Priority: 3
+ SortPriority: 4
+ - Regex: '^<.*/[[:alnum:]_]+\.h>'
+ Priority: 2
+ - Regex: '^".*'
+ Priority: 1
---