aboutsummaryrefslogtreecommitdiffhomepage
path: root/.clang-format
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-05-24 13:27:13 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-24 13:27:25 +0000
commit8f45138eef44f8b69cfb88650c6f069b4e5ba059 (patch)
treeea23e26be4b6cd6adf8f219e9987d1abf1743661 /.clang-format
parent84a4e5c0005da6affb745296675c096e423d4eec (diff)
Revert "Update clang-format matching more of Chromium"
This reverts commit 4fa5824fa2ae896670517d01c58ed4aef4a97941. Reason for revert: This is an area of Chromium's style guide that is actively error-prone, and I don't want anyone writing Skia code to think it's desirable. `goto fail`, etc. If we cannot automatically add braces, it is less error prone to keep these short statements on the same line as the condition. On the other hand, I believe clang-tidy can automate adding braces (readability-braces-around-statements). If we get that working I don't think it matters where the blocks go. Original change's description: > Update clang-format matching more of Chromium > > This CL does one thing: disallow short if/loop becoming a single > line. > > Skia style guide prefers to always have braces. Though always > have braces isn't achievable by clang-format, always breaking into > multiple lines can be set. > > > > > Bug: skia: > Change-Id: I70b504dea01b4c916901ea2247ac0e052d468051 > Reviewed-on: https://skia-review.googlesource.com/128688 > Commit-Queue: Weiliang Chen <weiliangc@chromium.org> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,weiliangc@chromium.org Change-Id: I264e0a38934aaf8059f503a64e204fd66da54769 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/129940 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format4
1 files changed, 2 insertions, 2 deletions
diff --git a/.clang-format b/.clang-format
index 6e9702e660..90eedd8b8f 100644
--- a/.clang-format
+++ b/.clang-format
@@ -20,8 +20,8 @@ AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true