mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Require braces on conditions and loops. (#218)
The rationale and rule for this was added in #194 to the C++ style guide we are using for Carbon. I've applied the automated fixes from running `clang-tidy` over all the code, and then run `clang-format` afterward. There are a few places where `clang-format` fixed a formatting issue that snuck through in prior commits. These were rare enough that it didn't seem worth splitting them out into a separate change.
This commit is contained in:
@@ -21,7 +21,8 @@ TEST(SourceBufferTest, StringRep) {
|
||||
EXPECT_EQ("Hello World", buffer.Text());
|
||||
|
||||
// Give a custom filename.
|
||||
auto buffer2 = SourceBuffer::CreateFromText("Hello World Again!", "/custom/text");
|
||||
auto buffer2 =
|
||||
SourceBuffer::CreateFromText("Hello World Again!", "/custom/text");
|
||||
EXPECT_EQ("/custom/text", buffer2.Filename());
|
||||
EXPECT_EQ("Hello World Again!", buffer2.Text());
|
||||
}
|
||||
@@ -29,7 +30,8 @@ TEST(SourceBufferTest, StringRep) {
|
||||
auto CreateTestFile(llvm::StringRef text) -> std::string {
|
||||
int fd = -1;
|
||||
llvm::SmallString<1024> path;
|
||||
auto error_code = llvm::sys::fs::createTemporaryFile("test_file", ".txt", fd, path);
|
||||
auto error_code =
|
||||
llvm::sys::fs::createTemporaryFile("test_file", ".txt", fd, path);
|
||||
if (error_code) {
|
||||
llvm::report_fatal_error(llvm::Twine("Failed to create temporary file: ") +
|
||||
error_code.message());
|
||||
|
||||
Reference in New Issue
Block a user