From 210bfe31e45fcac0b5f87a0ce51fbd3e4203acb4 Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 24 Jun 2018 10:49:23 +0200 Subject: [PATCH] Create CONTRIBUTING.md --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..5b715a51 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# NullWorks code style (Work in progress) + +## C/C++ + +### General + +- Code must be formatted with `clang-format`, the `.clang-format` settings file is provided within this repo. +- `using namespace` is strictly forbidden. +- [Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation) is forbidden. + +### File names + +`PascalCase`. + +### Header files + +Header files must have extension of `.hpp` and be guarded with `#pragma once` in the beginning. + +### Variable names + +- Variable names must be `lower_snake_case`, member variable names **must not** be prefixed by `m_` or any other prefixes. +- Constants must be in `UPPER_SNAKE_CASE` and use `constexpr`, not `#define`. For example: `constexpr int MAX = 100;`. + +### Namespace names + +Namespace names follow the same rules as *Variable names*. + +### Function names + +Function/method names must be in `lowerCamelCase`. + +### Class names + +- Class names must be in `PascalCase`. +- Struct names must be in `lower_snake_case`.