diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2013-09-02 07:42:02 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2013-09-02 07:42:02 +0000 |
| commit | bc36e6e0996267a58dbbfdee6e975a77bb780599 (patch) | |
| tree | 2096005d35febd8d105372dce35842a36cf33d70 /clang/test/Format | |
| parent | 402ee64f134e5d7d1b4f98ae3a6cf63c5d295775 (diff) | |
| download | bcm5719-llvm-bc36e6e0996267a58dbbfdee6e975a77bb780599.tar.gz bcm5719-llvm-bc36e6e0996267a58dbbfdee6e975a77bb780599.zip | |
Switch the default mode for clang-format to '-file'. Make 'LLVM' the
fallback syntax used when we fail to find a '.clang-format' file. Adjust
variable names appropriately.
Update the editor integration pieces that specify a '-style' option to
specify it as '-style=file'. I left the functionality in place because
even if the preferred method is to use '.clang-format' files, this way
if someone needs to clobber the style in their editor we show how to do
so in these examples.
Also check in a '.clang-format' file for Clang to ensure that separate
checkouts and builds of Clang from LLVM can still get the nice
formatting. =] This unfortunately required nuking the test for the
absence of a '.clang-format' file as now the directory happening to be
under your clang source tree will cause there to always be a file. ;]
llvm-svn: 189741
Diffstat (limited to 'clang/test/Format')
| -rw-r--r-- | clang/test/Format/style-on-command-line.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/test/Format/style-on-command-line.cpp b/clang/test/Format/style-on-command-line.cpp index 9b91259c650..6f81b9bf723 100644 --- a/clang/test/Format/style-on-command-line.cpp +++ b/clang/test/Format/style-on-command-line.cpp @@ -4,9 +4,8 @@ // RUN: clang-format -style="{BasedOnStyle: invalid, IndentWidth: 7}" %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK3 %s // RUN: clang-format -style="{lsjd}" %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK4 %s // RUN: [ ! -e %T/.clang-format ] || rm %T/.clang-format -// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK5 %s // RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %T/.clang-format -// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s +// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK5 %s void f() { // CHECK1: {{^ int\* i;$}} // CHECK2: {{^ int \*i;$}} @@ -15,9 +14,7 @@ void f() { // CHECK3: {{^ int \*i;$}} // CHECK4: Error parsing -style: Invalid argument, using LLVM style // CHECK4: {{^ int \*i;$}} -// CHECK5: Can't find usable .clang-format, using LLVM style -// CHECK5: {{^ int \*i;$}} -// CHECK6: {{^ int\* i;$}} +// CHECK5: {{^ int\* i;$}} int*i; int j; } |

