Back-end conventions

Coding style guide and best practices for back-end

Python

Python code is used for some packages and integration testing.

Rust

  • As a reference for our API development we are using the Rust API guidelines. Generally, these should be followed.
  • Prefer granular imports over glob imports like diesel::*.
  • Tests are written with the built-in testing framework.
  • Use the documentation example to know how to phrase and format your documentation.
  • Use consistent comment style:
    • /// doc comments belong above #[derive(Trait)] invocations.
    • // comments should generally go above the line in question, rather than in-line.
    • Start comments with capital letters. End them with a period if they are sentence-like.
  • Use comments to organize long and complex stretches of code that can’t sensibly be refactored into separate functions.
  • Code is linted with clippy.
  • Code is formatted with fmt.

Java