| 1 |
# Contributing |
| 2 |
|
| 3 |
Thanks for considering contributing to muon. Please send patches and questions |
| 4 |
to <~lattis/[email protected]>. Alternatively you may make a pull request at |
| 5 |
<https://github.com/muon-build/muon>. Before making any big changes, please send |
| 6 |
a proposal to the mailing list or open an issue so I can give you some pointers, |
| 7 |
and make sure you don't waste your time. |
| 8 |
|
| 9 |
## Contribution areas |
| 10 |
|
| 11 |
There are two main ways to contribute to Muon: |
| 12 |
- Add a [script module](scripting/adding_new_builtin.md). There are several |
| 13 |
unimplemented modules that could likely be easily written as a script module. |
| 14 |
See `src/script/modules` for examples. |
| 15 |
- Work on the runtime. Please read the documentation on [Muon |
| 16 |
Internals](internals.md). |
| 17 |
|
| 18 |
## C Style |
| 19 |
|
| 20 |
Muon uses a style similar to the linux kernel. A few differences are: |
| 21 |
|
| 22 |
- the return type of a function goes on the line above its declaration. |
| 23 |
e.g. |
| 24 |
|
| 25 |
```c |
| 26 |
int |
| 27 |
main(void) |
| 28 |
{ |
| 29 |
return 0; |
| 30 |
} |
| 31 |
``` |
| 32 |
|
| 33 |
- it still goes on the same line in a function prototype |
| 34 |
e.g. |
| 35 |
|
| 36 |
```c |
| 37 |
int main(void); |
| 38 |
``` |
| 39 |
|
| 40 |
- never omit braces for single statement if, else, for, while, etc. |
| 41 |
- avoid function-like macros except in exceptional cases |
| 42 |
- it is OK (but not great) if your line is more than 80 characters |
| 43 |
- please use fixed-width integer types (e.g. `uint32_t`, `uint64_t`, `uint8_t`) |
| 44 |
whenever possible |
| 45 |
|
| 46 |
As usual, just try to follow the style of surrounding code. |