Skip to content

Commit ae722bc

Browse files
authored
chore: add CONTRIBUTING.md (#4)
1 parent fadd3a0 commit ae722bc

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

CONTRIBUTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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`.

0 commit comments

Comments
 (0)