-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Reapply clang-format. #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reapply clang-format. #867
Conversation
$ clang-format -i -style=file \ $(find . | egrep '.*\.(h|cpp|inl)$')
@@ -630,7 +630,7 @@ Json::Value obj_value(Json::objectValue); // {} | |||
|
|||
void setComment(const char* text, size_t len); | |||
|
|||
char* comment_{nullptr}; | |||
char* comment_{ nullptr }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like this behavior, but it's what our .clang-format specifies so we'd better either accept it or change our .clang-format file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no preference, except for consistency. The status-quo is fine.
I'll also use clang-format in the future to maintain style consistency.
@@ -2354,14 +2354,22 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) { | |||
JSONCPP_STRING in; | |||
}; | |||
const TestData test_data[] = { | |||
{ __LINE__, true, "{\"a\":9}" }, { __LINE__, false, "{\"a\":0Infinity}" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These obviously need to all be on their own row. The EOL comments tell clang-format not to join them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -630,7 +630,7 @@ Json::Value obj_value(Json::objectValue); // {} | |||
|
|||
void setComment(const char* text, size_t len); | |||
|
|||
char* comment_{nullptr}; | |||
char* comment_{ nullptr }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no preference, except for consistency. The status-quo is fine.
I'll also use clang-format in the future to maintain style consistency.
@@ -2354,14 +2354,22 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) { | |||
JSONCPP_STRING in; | |||
}; | |||
const TestData test_data[] = { | |||
{ __LINE__, true, "{\"a\":9}" }, { __LINE__, false, "{\"a\":0Infinity}" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Also did some manual commenting to keep test data lines from joining up,
since they rely on
__LINE__
to be meaningful.