summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorNick Bray <ncbray@google.com>2018-08-01 13:27:41 -0700
committerNick Bray <ncbray@google.com>2018-08-01 13:29:12 -0700
commit75adda31de9a616c8b9ff09f828114a5a4b98c5e (patch)
treeea56bbe66c22e76bd1bdeca535cc0356221a573e /.clang-format
parent8fa9c4caee6616f5cdd09000c8612b2a173e18b6 (diff)
downloadsample-75adda31de9a616c8b9ff09f828114a5a4b98c5e.tar.gz
Enable pre-upload clang formatting.
Also re-format the code with clang format after doing some minor manual reformatting. Bug: 110489128 Change-Id: Ie26d781896749d6667cbaa601645dbe8fbbc0055
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format24
1 files changed, 24 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..97e6791
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,24 @@
+# Trusty Style
+# This is a Google-derived style with 4-space indent and a few quirks for
+# systems code.
+BasedOnStyle: Chromium
+
+# 4-space indent, no tabs.
+IndentWidth: 4
+UseTab: Never
+TabWidth: 4
+
+# Double indent arguments when none of them are on the first line.
+ContinuationIndentWidth: 8
+ConstructorInitializerIndentWidth: 8
+
+# Don't indent public/private/protected.
+# It's a little more common to do a half indent, but folks didn't like that.
+AccessModifierOffset: -4
+
+# Don't indent case labels.
+IndentCaseLabels: false
+
+# Don't break strings to make it easier to grep for error messages.
+# Note: this can result in lines that exceed the column limit.
+BreakStringLiterals: false