Skip to content

Commit abbb8de

Browse files
authored
Create CONTRIBUTING.md
1 parent 56f84f0 commit abbb8de

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

CONTRIBUTING.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# CONTRIBUTING
2+
3+
Any contributions (code, documentation, ...) are welcome. This project uses [cmocka](http://cmocka.org) for testing, you may need to check their documentation
4+
5+
# New Features
6+
- This library may not accept all new features, it is better to create an issue and get approval before coding
7+
- You must add test for every new feature
8+
- The feature must be compiled in both UNIX/POSIX systems (e.g. macos, linux...) and Windows
9+
10+
# Code Style
11+
This library is written with C99, don't try to add C++ files (yes it can compiled into lib),
12+
if you have enough reason to add C++ files than create an issue and get approval before coding,
13+
14+
- All functions must have `glm` prefix
15+
- Lines should be wrapped at 80 characters.
16+
- Don't invent new style for existing ones
17+
- Use C89 style comments (`/* comments */`) not C++ style comments (`// comments`)
18+
- Don't use TABs instead use 2 spaces for TABs
19+
- All indents must be 2 spaces, not 1 nor 4 space
20+
- All functions in `include` folder must be exported by `CGLM_EXPORT` and wrapped by `extern "C" {` for C++
21+
- Crate new line for return type, attribs:
22+
23+
```C
24+
CGLM_INLINE
25+
void
26+
glm_mul(mat4 m1, mat4 m2, mat4 dest)
27+
```
28+
29+
not acceptable:
30+
31+
```C
32+
CGLM_INLINE void glm_mul(mat4 m1, mat4 m2, mat4 dest)
33+
```
34+
- Variables must be declared at the top of a scope before usage:
35+
```C
36+
int x;
37+
int y;
38+
39+
x = y = 0;
40+
```
41+
42+
not acceptable:
43+
44+
```C
45+
int x;
46+
47+
x = 0;
48+
int y = 0;
49+
```
50+
51+
- All files must retain same LICENSE statement
52+
- Code with warnings will not be accepted, please suppress them (not by disabling them)
53+
- Run code anaylysis before submitting pull requests, if you use Xcode you can enable Sanitizer in scheme, you can use valgrind in linux

0 commit comments

Comments
 (0)