Run clang-format on the entire repo
This patch clang-formats the entire repo. Third-party code is
excluded.
I needed to fix up the .clang-format file so that all the header
includes are ordered properly. I could have sworn that it used to work
without the extra modification, but I guess not.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I64bb9f2c795401393f9dfe2fefc4f04cb36b52f6
diff --git a/.clang-format b/.clang-format
index 6eb0ed4..384832b 100644
--- a/.clang-format
+++ b/.clang-format
@@ -7,9 +7,30 @@
PointerAlignment: Right
Standard: Cpp11
IncludeCategories:
- # Force node headers to be considered third-party headers.
- - Regex: '^<(node|v8).h>$'
+ # Force some headers to be considered third-party headers.
+ - Regex: '^<(cxx|Halide|HalidBuffer|lzma|node|v8|osqp|oscqp\+\+|snappy|snappy-sinksource).h>$'
Priority: 3
+ # Force some more third-party headers to be appropriately categorized.
+ - Regex: '^(<|")(absl|ceres|ctre|Eigen|external|FRC_NetworkCommunication|foxglove|flatbuffers|glib-2.0|glog|gflags|gmock|gtest|google|libusb-1.0|lz4|opencv2|openssl|rawrtcc|sanitizer|single_include|third_party|wpi)/.*(>|")$'
+ Priority: 3
+ # The default regexes. For some reason, if we don't specify them here, then
+ # clang-format will overwrite them with the custom ones we specify above.
+ - Regex: '^<ext/.*\.h>'
+ Priority: 2
+ SortPriority: 0
+ CaseSensitive: false
+ - Regex: '^<.*\.h>'
+ Priority: 1
+ SortPriority: 0
+ CaseSensitive: false
+ - Regex: '^<.*'
+ Priority: 2
+ SortPriority: 0
+ CaseSensitive: false
+ - Regex: '.*'
+ Priority: 4
+ SortPriority: 0
+ CaseSensitive: false
---
Language: JavaScript