-
Notifications
You must be signed in to change notification settings - Fork 14
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
Suggest use of clang-format #9
Comments
The current formatting style is quite consistent with itself. When in doubt, looking at the surrounding code and similar sections should help to clarify things. Although, having a format spec would ease code reviews, so I'll have a look. What do you specifically find unreasonable regarding the current formatting style? |
Yes, you're right. The formatting is consistent with itself - sorry for the bad explanation/misleading topic. Just as an example: When do you write spaces with curly braces initializions? I couldn't tell you which form of the above example I would write intuitively as I don't really care - I think thats the job of a formatting tool. |
I can see how a formatter would make things easier. I haven't had a chance to try out clang-format yet, but I still plan on checking it out. Interestingly, the example you provided for how spaces are formatted with uniform initialization syntax, has the following surrounding lines: // the public directory for serving static files
std::string public_dir {};
// default index filename for the public directory
std::string index_file {"index.html"};
// socket timeout
std::chrono::seconds timeout {10};
// serve static files from public directory
bool http_static {true};
// serve dynamic content
bool http_dynamic {true};
// upgrade http to websocket connection
bool websocket {true}; |
It was just an proposal and the example was the first that passed through my mind. "I couldn't tell you which form of the above example I would write intuitively". |
It's hard to comply to the coding style, a clang-format file would help at some points:
The "nearest" style actually seems something like
(Used whatstyle to analyze).
What do you think about adding some reasonable style format?
The text was updated successfully, but these errors were encountered: