Skip to content

Commit

Permalink
Explicitly mention that backticks should be used going forward
Browse files Browse the repository at this point in the history
http://crrev.com/c/chromium/src/+/2253463/comment/2c9fbf8e_41d26e34/
mentions that we are less concerned about being consistent and care more
about doing the right thing going forward.
Turn this into an explicit rule here so people don’t have to go through
blame and dig up CLs where this is discussed.

Change-Id: I6e9344280c4ab336a717216f7b2f9c29de14261d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4649209
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Christoph Schlosser <cschlosser@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1174784}
  • Loading branch information
cschlosser authored and Chromium LUCI CQ committed Jul 25, 2023
1 parent 02a6484 commit cbb0925
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions styleguide/c++/c++-dos-and-donts.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,17 @@ Good::Good() = default;
## Comment style
References to code in comments should be wrapped in `` ` ` `` pairs. Codesearch uses
this as a heuristic for finding C++ symbols in comments and generating
cross-references for that symbol.
References to code in comments should be wrapped in `` ` ` `` pairs. Codesearch
uses this as a heuristic for finding C++ symbols in comments and generating
cross-references for that symbol. Historically, Chrome also used `||` pairs to
delimit variable names; codesearch understands both conventions and will
generate a cross-reference either way. Going forward, prefer the new style even
if existing code uses the old one.
* Class and type names: `` `FooClass` ``.
* Function names: `` `FooFunction()` ``. The trailing parens disambiguate
against class names, and occasionally, English words.
* Variable names: `` `foo_var` ``. Historically, Chrome also used `||` pairs to
delimit variable names; codesearch understands both conventions and will
generate a cross-reference either way.
* Variable names: `` `foo_var` ``.
* Tracking comments for future improvements: `// TODO(crbug.com/12345): ...`,
or, less optimally, `// TODO(knowledgeable_username): ...`. Tracking bugs
provide space to give background context and current status; a username might
Expand Down

0 comments on commit cbb0925

Please sign in to comment.