Last active
December 23, 2017 04:47
-
-
Save DavidEGrayson/9386c83394b3f9b9e7363d71d3958ed1 to your computer and use it in GitHub Desktop.
AllowShortBlocksOnASingleLine is not working with clang-format 5.0.0 on Manjaro Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ clang-format --version | |
clang-format version 5.0.0 (tags/RELEASE_500/final) | |
$ cat .clang-format | |
AllowShortBlocksOnASingleLine: true | |
$ cat test.cpp | |
int foo(int x) | |
{ | |
if (x == 0) { return 1; } | |
return 10 / x; | |
} | |
$ clang-format -style=file test.cpp | |
int foo(int x) { | |
if (x == 0) { | |
return 1; | |
} | |
return 10 / x; | |
} | |
# Expected behavior: clang-format should allow the one-line if statement, not turn it into 3 lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment