Skip to content

Commit

Permalink
doc: add Table of Contents to Cpp style guide
Browse files Browse the repository at this point in the history
The Cpp style guide is growing. IMHO, a Table of Contents makes
it easier to navigate.

PR-URL: nodejs#17052
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
  • Loading branch information
fhinkel committed Nov 16, 2017
1 parent 787863d commit ed0327b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CPP_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# C++ Style Guide

## Table of Contents

* [Left-leaning (C++ style) asterisks for pointer declarations](#left-leaning-c-style-asterisks-for-pointer-declarations)
* [2 spaces of indentation for blocks or bodies of conditionals](#2-spaces-of-indentation-for-blocks-or-bodies-of-conditionals)
* [4 spaces of indentation for statement continuations](#4-spaces-of-indentation-for-statement-continuations)
* [Align function arguments vertically](#align-function-arguments-vertically)
* [Initialization lists](#initialization-lists)
* [CamelCase for methods, functions and classes](#camelcase-for-methods-functions-and-classes)
* [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters)
* [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields)
* [Space after `template`](#space-after-template)
* [Type casting](#type-casting)
* [Memory allocation](#memory-allocation)
* [`nullptr` instead of `NULL` or `0`](#nullptr-instead-of-null-or-0)
* [Do not include `*.h` if `*-inl.h` has already been included](#do-not-include-h-if--inlh-has-already-been-included)
* [Avoid throwing JavaScript errors in nested C++ methods](#avoid-throwing-javascript-errors-in-nested-c-methods)

Unfortunately, the C++ linter (based on
[Google’s `cpplint`](https://github.com/google/styleguide)), which can be run
explicitly via `make lint-cpp`, does not currently catch a lot of rules that are
Expand Down

0 comments on commit ed0327b

Please sign in to comment.