Thank you for wanting to contribute to PatchworkOS!
Included here are instructions on how to contribute, try to follow them as best you can but don't sweat it if you make mistakes. (These instructions are currently WIP)
For major changes like feature additions or architectural modifications, please open a discussion first to discuss the change.
For bug fixes, documentation improvements, and minor enhancements, feel free to jump straight into a pull request.
Follow the conventional commit format used throughout the project:
type(scope): descriptionFor example:
fix(readme): fix typo in setup instructionsfeat(kernel:sched): add constant-time schedulerrefactor(libstd): reorganize memory functions
Note the use of lowercase and present tense ("add" not "added").
If you submit code, please follow these conventions.
- For variables use
camelCase. - For functions use
snake_case. - For macros and constants use
SCREAMING_SNAKE_CASE. - All internal functions, variables, macros or constants in libstd must be prefixed with
_like_my_function(),_myVariableor_MY_CONSTANTto avoid conflicts.
Follow the formatting outlined in the .clang-format file.
Applying formatting is as simple as running make format, always run this before pushing a commit.
In the kernel errno should be used to store error codes, all functions that error should either propagate an error from a lower-level function or set errno directly.
Functions should communicate that an error has occurred by returning either ERR or NULL depending on if they return an integer or a pointer.
- In if statements, be explicit, write
ptr == NULLnot!ptr. Booleans are an exception (if (flag)is fine).
Feel free to open an issue if you have questions about contributing!