// RUN: grep -Ev "// *[A-Z-]+:" %s > %t2.cpp
// RUN: clang-format -style=LLVM %t2.cpp > %t.cpp
-// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
-// CHECK: {{^\{ "IncompleteFormat": true }}
+// RUN: FileCheck -strict-whitespace -cursor=0 -input-file=%t.cpp %s
+// CHECK: {{"IncompleteFormat": true}}
// CHECK: {{^int\ \i;$}}
int i;
// CHECK: {{^f \( g \(;$}}
FormatStyle FormatStyle = getStyle(
Style, (FileName == "-") ? AssumeFilename : FileName, FallbackStyle);
bool IncompleteFormat = false;
- tooling::Replacements Replaces = reformat(FormatStyle, Sources, ID, Ranges, &IncompleteFormat);
+ tooling::Replacements Replaces =
+ reformat(FormatStyle, Sources, ID, Ranges, &IncompleteFormat);
if (OutputXML) {
llvm::outs() << "<?xml version='1.0'?>\n<replacements "
"xml:space='preserve' incomplete_format='"
else if (Rewrite.overwriteChangedFiles())
return true;
} else {
- outs() << "{";
if (Cursor.getNumOccurrences() != 0)
- outs() << " \"Cursor\": "
- << tooling::shiftedCodePosition(Replaces, Cursor) << ",";
- outs() << " \"IncompleteFormat\": "
- << (IncompleteFormat ? "true" : "false") << " }\n";
+ outs() << "{ \"Cursor\": "
+ << tooling::shiftedCodePosition(Replaces, Cursor)
+ << ", \"IncompleteFormat\": "
+ << (IncompleteFormat ? "true" : "false") << " }\n";
Rewrite.getEditBuffer(ID).write(outs());
}
}