GOKZ is a community project. All are welcome to contribute as long as they follow the guidelines.
- Create an issue so that we may first discuss the proposed changes or additions.
- Fork the repository (https://github.com/KZGlobalTeam/gokz).
- Create a new branch off of the
dev
branch. - Commit and push your code to your new branch.
- Create a pull request targeting our
dev
branch, making a reference to the issue.
Once your pull request is checked and approved, your branch will be merged into our dev
branch. Keep an eye out for any comments and requested changes. Your changes will then be released in the next version of GOKZ!
To keep our code beautiful and maintainable, please adhere to the style guide.
As a general rule, the style of your code should match what already exists. It is recommended to use SPCode and its built-in syntax reformatter to assist formatting your code to match the project's style.
Our SourcePawn code is written in the transitional syntax introduced with SourceMod 1.7.
-
Use tabs for indenting.
-
Use Allman style brace placement.
static void DoSomething()
{
for (...)
{
if (...)
{
}
else
{
}
}
}
- Method names begin with a uppercase letter (Pascal case), whilst variables begin with lowercase letter (camel case).
void SomeFunction(int someVariable)
{
...
}
- Prefix the name of primitive type global variables to indicate the type of the variable.
int gI_SomeIntVar;
bool gB_SomeBoolVar;
float gF_SomeFloatVar;
- Use self-documenting function and variable names. Only comment if necessary or in
.inc
files.
-
Avoid introducing global variables. Instead, consider writing public accessor functions (
SetX
,GetX
). -
Keep guard clauses (early
return
) such asIsValidClient
checks at the top of function implementations.