Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 2.28 KB

CONTRIBUTING.md

File metadata and controls

84 lines (63 loc) · 2.28 KB

Contributing

AtomVM is open to any contribution.

Pull requests, bug reports and feature requests are welcome.

However before contributing, please read carefully our Code of Conduct and the following contribution guidelines.

Please, also make sure to understand the Apache 2.0 license and the Developer Certificate of Origin.

Last but not least, do not use GitHub issues for vulnerability reports, read instead the security policy for instructions.

Git Recommended Practises

Coding Style

C Code

Style is enforced with clang-format-13. To automatically fix a file, run:

clang-format-13 --style=file -i file.c

Identation

Good:

void f(int reverse)
{
    if (reverse) {
        puts("!dlroW olleH");
    } else {
        puts("Hello world");
    }
}

Bad:

void f(int reverse) {
    if (reverse)
        puts ("!dlroW olleH");
    else
        puts ("Hello world");
}

Names

  • Struct names are PascalCase (e.g. Context)
  • Scalar types are lower case (e.g. term)
  • All other names (e.g. functions and variables) are snake_case (e.g. term_is_integer)
  • Always prefix function names (e.g. term_is_nil, term_is_integer, context_new, context_destroy)

Other Coding Conventions

  • Pointer * should be with the variable name rather than with the type (e.g. char *name, not char* name)
  • Avoid long lines, use intermediate variables with meaningful names.

Elixir Code

Just use Elixir formatter enforced style.