FerryDocs
ContributingDevelopment setup

Coding rules

The rules of DESIGN.md apply to each crate. Two commands check the format and the lints.

Edit on GitHub
Terminal
cargo fmt
cargo clippy --workspace --all-targets -- -D warnings

The two commands must pass. cargo fmt is the : the rustfmt.toml of the repository sets a width of 120 columns. cargo clippy runs the .

The rules

The rules come from the section "Coding rules" of DESIGN.md. They apply to each crate.

SubjectRule
RustRust 2024, stable toolchain.
unwrap() and expect()Not outside tests. The only exception is an that a comment explains.
todo!()Leave none in the code.
ErrorsUse ferry_core::Error. Put context in the message: pulling image nginx: ….
LogsUse : info for lifecycle events, debug for detail. Never log secrets.
Run tar and heavy filesystem work in spawn_blocking.
Public signaturescrates/*/src/lib.rs is the contract between crates. Change a signature on purpose, and say so in the change. You can organize private modules as you want.
DependenciesAdd them to the Cargo.toml of the crate, with an explicit version. Do not add them to the workspace root.
CratesA crate must not depend on another crate outside the dependency graph.

The error gives the HTTP status

The variant of ferry_core::Error decides the HTTP status of the answer. Examples:

VariantStatus
Invalid400
NotFound404
Conflict409
Docker502

Then run the tests.

On this page