notcurses/CONTRIBUTING.md
igo95862 5f45d9178b Added information about C standard to the CONTRIBUTING
Probably useful for people who want to contribute C code.
2020-12-02 12:17:30 -05:00

32 lines
1.5 KiB
Markdown

# Contributing to Notcurses
Your quality contributions are cheerfully appreciated, however small. Example
code and documentation are especially welcome.
Changes ought reflect the style of the surrounding matter, whether code or
documentation. The styles used in the C core, the C++ wrappers, and the Rust
wrappers are quite distinct; use the appropriate style for the language.
New features should have unit tests. It is appreciated if bugfixes have
unit tests, as well. Wrappers in a new language absolutely must have at
least some superficial tests (it is not necessary to deeply test the
underlying functionality in each language). Adding a wrapper implies that
you're prepared to maintain that wrapper; if you can't maintain it, the wrapper
will likely be removed.
Escape sequences available from terminfo must not be hard-coded. Routines must
check to ensure the relevant escape sequence is valid for the current TERM
definition, and not emit it if invalid. Routines emitting characters beyond
the 128 elements of ASCII should check for UTF8 availability, and fall back to
an ASCII equivalent if not present (or return an error).
Run `make test` with your changes, and ensure all tests pass. Run
`notcurses-demo` as well, if you changes are to the core library or the
demo code.
## C standard
Notcurses targets the ISO C11 standard. This means you should avoid using
GNU C extensions as they might not work outside GCC/Clang. To verify your code
standard compliance on GCC and Clang you can complile with `-std=c11 -pedantic`
command line arguments.