mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 17:12:31 +00:00
add style guide
This commit is contained in:
parent
2ed949a6ae
commit
0a482bbbfe
16
doc/style.md
Normal file
16
doc/style.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Official Style Guide
|
||||
|
||||
These conventions are not enforced by the compiler, but they are shipped in
|
||||
this documentation along with the compiler in order to provide a point of
|
||||
reference, should anyone wish to point to an authority on agreed upon Zig
|
||||
coding style.
|
||||
|
||||
* 4 space indentation
|
||||
* `camelCaseFunctionName`
|
||||
* `TitleCaseTypeName`
|
||||
* `snake_case_variable_name`
|
||||
* Open braces on same line, unless you need to wrap.
|
||||
* If a list of things is longer than 2, put each item on its own line and
|
||||
exercise the abilty to put an extra comma at the end.
|
||||
|
||||
See Zig standard library for examples.
|
Loading…
Reference in New Issue
Block a user