This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
nekohook/contributing.md
2020-08-04 13:13:01 -04:00

2.2 KiB

Contributing to nekohook

Note:

This is old, needs updating.

About

Nekohook was made to replace and improve on cathook and the flaws I've seen with it.
Avoid doing useless computations... If you can keep everything on stack, doesnt mean u cant use std::string for heap storage, just means avoid "new" or malloc unless absolutly needed...

With the way nekohook was constructed, it is meant to work for multiple games. This means avoid including anything from your modules into nekohook. This will add a dependancy of your module to nekohook which isnt wanted... Use nekohooks own "modular" functions like the ones in src/framework/entities.hpp, src/framework/input.hpp, etc...
These are ment to "pass through" your modules functions to nekohook, use them.

Code

Style

Loosely follow the google style guide unless the below guidelines overrule.

Use brackets on same line rather than new line.
Omit brackets entirely if one liner actions

// Good
if (true) {
    // Stuff
}
if (1 == 0)
    Stuff();

// Bad
if (false)
{
    // Stuff
}

Use 4 space indentation please!

Naming

AVOID HUNGARIAN NOTATION AT ALL COSTS!!!
You should have a proper ide, use its features!
(Exception is kConstNames)

Name functions with capital and CamelCase. This includes std::function and derivatives.
Any and every variable should be named with lower_case_and_underlines. This includes globals and statics.

Use the google style guides kConstName format for enums and constants

Commiting changes

Setup branch

Clone the repo
git clone https://github.com/oneechanhax/nekohook
Make a new branch for your changes
git checkout -b <name goes here>

Commit changes

Stage file for a commit
git add <file changed>
Ensure only wanted files are being commited
git status
Commit the changes
git commit -m "<This is the commit name>"

If you made multiple commits for one issue or feature, place all commits you have made locally into one commit!

Finally push to github
git push