Toolbox snapshot
The Reactive C++ Toolbox
|
We want to make contributing to this project as easy and transparent as possible. All contributions are welcome.
The code of conduct is described in CODE_OF_CONDUCT.md.
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.
"Re-establishing the context of a piece of code is wasteful. We can't avoid it completely, so our efforts should go to reducing it [as much] as possible. Commit messages can do exactly that and as a result, a <em>commit message shows whether a developer is a good collaborator</em>." – Peter Hutterer
The seven rules of a great git commit message:
See How to Write a Git Commit Message by Chris Beams.
GitHub issue numbers should be referenced on the last line of the commit message. Keywords can be used to automatically close issues. For example:
We actively welcome your pull requests.
master
;clang-format
on your changes.Follow CppCoreGuidelines for anything not covered in this section.
Go Proverbs also offers some great advice:
.hpp
extension;.cpp
extension;.ut.cpp
extension.Use ClangFormat to format source-code changes. The clang-format
build target formats the entire source tree:
Alternatively, if you are using Unix Makefiles:
Namespaces can be used to disambiguate conflicting type names, so there is no need to prefix type names with the namespace name. The HTTP server in the http namespace, for example, is called Serv, not HttpServ.
The public
section is first, followed by protected
and then private
. Within each section, members are generally ordered as follows:
Const functions precede non-const functions for two reasons:
Use assert
statements to formalise contract and document assumptions.
Comments documenting declarations should be full sentences, even if that seems a little redundant. This approach makes them format well when extracted into Doxygen documentation.
Exception messages should not be capitalised (unless beginning with proper nouns or acronyms) or end with punctuation, since they are usually printed following other context. That is, use throw runtime_error{"something bad"}
not throw runtime_error{"Something bad"}
, so that the example below formats without a spurious capital letter mid-message.
Long running applications and services should log exceptional conditions and life-cycle events. Logging in library code, where the run-time context is often unknown, is generally frowned upon and should be kept to a minimum. Log files should be kept clean and readable; they should not be used to trace the normal flow of execution in production code.
By contributing to Toolbox, you agree that your contributions will be licensed under the Apache 2.0 License. A copy of the license is available in the LICENSE.md file in the root directory of this source tree.