File tree Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Contribution Guide
2
+
3
+ ### Formatting
4
+
5
+ Slightly modified "Chromium" ` clang-tidy ` configuration.
6
+
7
+ ### Style
8
+
9
+ See https://google.github.io/styleguide/cppguide.html .
10
+
11
+ Quick start:
12
+
13
+ ** Class member variables**
14
+ ``` c++
15
+ class Thing {
16
+ std::string foo_ ;
17
+ std::string bar_baz_ ;
18
+ };
19
+ ```
20
+ **Struct member variables**
21
+ ```c++
22
+ struct Thing {
23
+ std::string foo;
24
+ std::string bar_baz;
25
+ };
26
+ ```
27
+ ** Class names**
28
+ ``` c++
29
+ class Foo ;
30
+ class BarBaz ;
31
+ ```
32
+ ** Functions**
33
+ ``` c++
34
+ DoTheFoo ();
35
+ Bar ();
36
+ ```
37
+ ** Constants**
38
+ ``` c++
39
+ const int kFooBarBaz = 1 ;
40
+ ```
41
+ ** Enums**
42
+ ``` C++
43
+ enum class Foo {
44
+ kUnknown = 0,
45
+ kBar,
46
+ };
47
+ ```
48
+
49
+ **Divergence: file names**
50
+
51
+ In C:
52
+ ```
53
+ file_name.c
54
+ file_name.h
55
+ ```
56
+ In C++:
57
+ ```
58
+ file_name.cpp
59
+ file_name.hpp
60
+ ```
61
+ ### C++ Standard
62
+
63
+ C++17.
64
+
65
+ ### C Standard
66
+
67
+ C99.
68
+
69
+ ### Testing
70
+
71
+ Use `googletest`.
72
+
73
+ ### Exporting
74
+
75
+ Symbols should be hidden by default. Only export what is part of the public API.
76
+
77
+
78
+ ### Include Guards
79
+
80
+ Use `#pragma once`.
You can’t perform that action at this time.
0 commit comments