aboutsummaryrefslogtreecommitdiff
path: root/docs/CODING.md
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-05-02 10:01:47 +0200
committerGitHub <[email protected]>2023-05-02 10:01:47 +0200
commit075d17f8ada47e990fe94606c3d21df409223465 (patch)
treee50549b766a2f3c354798a54ff73404217b4c9af /docs/CODING.md
parentfix: bundle shouldn't append content zip to zen (diff)
downloadzen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz
zen-075d17f8ada47e990fe94606c3d21df409223465.zip
moved source directories into `/src` (#264)
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees
Diffstat (limited to 'docs/CODING.md')
-rw-r--r--docs/CODING.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/CODING.md b/docs/CODING.md
new file mode 100644
index 000000000..c4be7906c
--- /dev/null
+++ b/docs/CODING.md
@@ -0,0 +1,24 @@
+# Naming Conventions
+
+The naming conventions for Zen are intended to remain close to the Unreal Engine coding style, with some minor exceptions wrt prefixes.
+
+* Classes/Structs - `PascalCase`
+* Functions - `PascalCase()`
+* Class member variables - `m_PascalCase`
+* Global variables - `g_PascalCase`
+* Static variables - `s_PascalCase`
+* Thread local variables - `t_PascalCase`
+
+Those who are familiar with the UE coding standards will note that we do not require or encourage `F` prefixes on struct or classes, and we expect class members to have a `m_` member prefix.
+
+# Code formatting
+
+To ensure consistent formatting we rely on `clang-format` to automatically format source code. This leads to consistent formatting which should lead to fewer surprises and more straightforward merging.
+
+Formatting is ensured by using [pre-commit](https://pre-commit.com/)
+
+- [Ensure you have a Python install](https://www.python.org/downloads/) and that Python has been added to the PATH environment variable
+- [Install pre-commit](https://pre-commit.com/#installation) so it is available in PATH
+- Run pre-commit manually on staged files `pre-commit run`
+- Run pre-commit manually on all files `pre-commit run --all-files`
+- Install git commit hooks `pre-commit install`, which will automatically run before every commit.