You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2015/11/21 02:06:16 UTC
mesos git commit: Added backtick usage in comments to the C++ style
guide.
Repository: mesos
Updated Branches:
refs/heads/master bffe14b37 -> 7e81e50df
Added backtick usage in comments to the C++ style guide.
Review: https://reviews.apache.org/r/40367
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7e81e50d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7e81e50d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7e81e50d
Branch: refs/heads/master
Commit: 7e81e50dfac7309b9d75040c353e40ebed2f2ae0
Parents: bffe14b
Author: Greg Mann <gr...@mesosphere.io>
Authored: Fri Nov 20 17:04:49 2015 -0800
Committer: Timothy Chen <tn...@gmail.com>
Committed: Fri Nov 20 17:04:49 2015 -0800
----------------------------------------------------------------------
docs/c++-style-guide.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7e81e50d/docs/c++-style-guide.md
----------------------------------------------------------------------
diff --git a/docs/c++-style-guide.md b/docs/c++-style-guide.md
index 3f381cb..678faeb 100644
--- a/docs/c++-style-guide.md
+++ b/docs/c++-style-guide.md
@@ -50,6 +50,20 @@ void Slave::statusUpdate(StatusUpdate update, const UPID& pid)
## Comments
* End each sentence within a comment with a punctuation mark (please note that we generally prefer periods); this applies to incomplete sentences as well.
* For trailing comments, leave one space.
+* Use backticks when quoting code excerpts or object/variable/function names. For example:
+
+~~~{.cpp}
+// Use `SchedulerDriver::acceptOffers()` to send several offer
+// operations. This makes use of the `RESERVE()` and `UNRESERVE()`
+// helpers, which take a `Resources` object as input and produce
+// appropriate offer operations. Note that we are unreserving the
+// resources contained in `dynamicallyReserved1`.
+driver.acceptOffers({offer.id()},
+ {UNRESERVE(dynamicallyReserved1),
+ RESERVE(dynamicallyReserved2),
+ RESERVE(dynamicallyReserved3)},
+ filters);
+~~~
## Breaks
* Break before braces on enum, function, and record (i.e. struct, class, union) definitions.