mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 09:57:08 +08:00
clang-format: Tweak -style=Chromium for Java files.
For Java, don't do any of the deviations from Google Style that Chromium style does for C++. Chromium's Java follows Android Java style [1], which is roughly Google Java style with an indent of 4 and a continuation indent of 8. 1: https://source.android.com/source/code-style.html llvm-svn: 222839
This commit is contained in:
@@ -69,6 +69,21 @@ TEST_F(FormatTestJava, FormatsInstanceOfLikeOperators) {
|
||||
Style);
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJava, Chromium) {
|
||||
verifyFormat("class SomeClass {\n"
|
||||
" void f() {}\n"
|
||||
" int g() {\n"
|
||||
" return 0;\n"
|
||||
" }\n"
|
||||
" void h() {\n"
|
||||
" while (true) f();\n"
|
||||
" for (;;) f();\n"
|
||||
" if (true) f();\n"
|
||||
" }\n"
|
||||
"}",
|
||||
getChromiumStyle(FormatStyle::LK_Java));
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJava, ClassKeyword) {
|
||||
verifyFormat("SomeClass.class.getName();");
|
||||
verifyFormat("Class c = SomeClass.class;");
|
||||
|
||||
Reference in New Issue
Block a user