-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-3061 Move coding guidelines into a separate document #1168
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
Conversation
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.
LGTM with minor comments addressed.
etc/coding_guidelines.md
Outdated
|
||
- License | ||
- Include Guard (`#pragma once`) | ||
- Header Prelude |
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.
CXX-2258 intended to change the order to include the Header Prelude
after System Headers
and Driver Headers
. Suggest updating ordering and the example below.
Suggestion can be ignored if this is expected to be revised with upcoming PRs.
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.
Most of this is expected to be overwritten by an upcoming PR (including the entire "general structure" guildeline), but regardless, our ClangFormat configuration automatically sorts headers by priority (for the most part) so this guideline can probably be removed. Replaced all header specs with "Include Directives" instead.
etc/coding_guidelines.md
Outdated
|
||
- Blank line at beginning and end of class declaration | ||
- Public section up top / private at bottom | ||
- Lifecycle methods first (see rules above) |
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.
- Lifecycle methods first (see rules above) | |
- Lifecycle methods first |
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.
Reworded to "special member functions".
Summary
Resolves CXX-3061. Precursor changes to CXX-2745 concerning documentation of coding guidelines.
Docs changes will be required to make this page consistent with the new CONTRIBUTING.md file contents.
Contribution Guidelines
A large portion of the contents of the
CONTRIBUTING.md
document is very old and describe coding guidelines moreso than contribution guidelines. Furthermore, the instructions are both too detailed in some respects and too vague in others. Given the expected volume of coding guideline updates to come in light of CXX-2745 (Stable ABI), this PR proposes a small tidy-up of this file.Given our current PR-based contribution, development, and review workflow, this PR proposes keeping the (external) contribution guidelines simple and to-the-point. Details may be addressed during code review and merge of the PR by the maintainer (who may edit the commit subject and description as-needed at time of merge).
Coding Guidelines
The extensive coding guidelines describing the architecture, interface design, and coding style is moved into a new and seperate
etc/coding_guidelines.md
file to avoid cluttering the external contribution guidelines. This file is not expected to require documentation changes (for repo only).References to the MongoDB Server coding and style guidelines and the Google C++ Style Guide are removed: I do not believe we ever refer to these in practice. I believe there is enough existing code in the CXX Driver which may be used to inform and maintain consistency of style without relying on explicit guidelines.
The "Lifecycle Methods" section is removed due to dubious value.
The contents of the coding guidelines are expected to be updated in a followup PR as part of CXX-2745.