Repository navigation
Add clang-format - #291
Add clang-format#291krlmlr wants to merge 10 commits into
Conversation
krlmlr
left a comment
There was a problem hiding this comment.
Thanks! I'd like to do a couple more iterations.
| bool DbConnection::is_valid() { | ||
| return !!get_conn(); | ||
| } | ||
| bool DbConnection::is_valid() { return !!get_conn(); } |
There was a problem hiding this comment.
I'd rather avoid braces on a single line.
| _["thread.id"] = (int) mysql_thread_id(pConn_) | ||
| ); | ||
| _["protocol.version"] = (int)mysql_get_proto_info(pConn_), | ||
| _["thread.id"] = (int)mysql_thread_id(pConn_)); |
There was a problem hiding this comment.
Can we move the closing paren ); to the next line?
There was a problem hiding this comment.
This feature will be added to clang-format. Seems now doesn't exists.
| if (pCurrentResult_ != NULL) { | ||
| if (pResult != NULL) | ||
| warning("Cancelling previous query"); | ||
| if (pResult != NULL) warning("Cancelling previous query"); |
There was a problem hiding this comment.
I'd like to always add braces, but keep it on a new line.
| const Nullable<std::string>& password, | ||
| const Nullable<std::string>& db, unsigned int port, | ||
| const Nullable<std::string>& unix_socket, | ||
| unsigned long client_flag, const Nullable<std::string>& groups, |
There was a problem hiding this comment.
Can we ensure that each argument gets its own line in these cases?
There was a problem hiding this comment.
I think now it's not possible. Clang-format add new line if arguments are to long, but it doesn't check the context of this lines.
| case MY_INT64: | ||
| binding_update(j, MYSQL_TYPE_LONGLONG, 0); | ||
| break; | ||
| case MY_LGL: |
There was a problem hiding this comment.
The original indent was fine.
| std::vector<MYSQL_TIME> time_buffers; | ||
|
|
||
| public: | ||
| public: |
There was a problem hiding this comment.
Single-space indent for access modifiers looks awkward, but I'm willing to be convinced otherwise.
| #include "MariaResultPrep.h" | ||
| #include "MariaResultSimple.h" | ||
|
|
||
| #include "pch.h" |
There was a problem hiding this comment.
Why did the "include" move? The pch.h include must come first here.
There was a problem hiding this comment.
Clang-format reordering header includes by some rules. But I think it's more general question. Seems pch.h is not "real" precompiled header, it's more like general include.
But it cause to problem with order of includes, so if order is changes then build is failing.
Maybe it is make sense to fix includes, that they do not depend on the order?
There was a problem hiding this comment.
We could specify IncludeCategories so that pch.h is always sorted first?
|
Found useful tool to check configurations of clang-format: https://zed0.co.uk/clang-format-configurator/ |
|
Can we try https://clangpowertools.com/clang-format-editor.html on the main branch? |
|
We also want |
|
Done already. |
No description provided.