aboutsummaryrefslogtreecommitdiff
path: root/CODING.md
blob: 54774590f7158671c6d939a902294c0c3a0dc321 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Naming Conventions

The naming conventions for Zen are intended to resemble the Unreal Engine coding style, with some minor exceptions.

* Classes/Structs - `PascalCase`
* Functions - `PascalCase()`
* Class member variables - `m_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 less surprises and more straightforward merging.

Formatting is ensured by using [pre-commit](https://pre-commit.com/)
- [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.