Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Contributing

Thank you for investing your time in contributing to this project. There are many ways to contribute and we value all of them.

Posting or commenting an issue

If you find a bug or want to discuss a feature, open an issue.

When posting a new comment on an issue, make sure your comment adds value. Don’t post a comment just to get attention.

Remember that we are humans: we like support, and we expect kindness :)

Writing code

Any contribution should resolve a work item. If there is no work item about the change you want to introduce, then create one for discussing that.

We try to follow most of the Rust API guidelines and the Rust standard library policies.

Fork the repository

If you don’t have a write access to the SmolPhone repository, you can fork the repository.

git clone your fork and create a dedicated branch for each feature or bug that you are working on:

git switch -c my-new-branch

Format your changes

Execute cargo fmt to format your code. You can also use our cargo alias: cargo f.

Lint your changes

Execute cargo clippy --all-targets --all-features to lint your code. You can also use our cargo alias: cargo l.

Also check the docs using cargo doc --all-features --no-deps, or our cargo alias cargo d.

Build and test your changes

Execute cargo test --all-features to execute unit tests and doc-tests. You can also use our cargo alias: cargo t.

The device/ and picocalc/ workspaces don’t support tests because of the hardware they target.

Commit your changes

This project follows a specific format for commit messages. A commit head starts with an optional scope between square brackets and ends with the capitalized title. The scope corresponds to the affected crate. For brevity, we omit the smolphone_ prefix from the crate name. The commit body details the change.

For example, the following commit affects the os/smolphone_graphics crate:

[graphics] Improve image and font abstraction

- A font now uses a binary image internally.
- A glyph is now a subimage.
- Add a method to get the bounding box of a subimage.
- Add GraphicsContext that stores fonts and images used by the
  drawing phase.

Please rebase your change on main before creating your merge-request. We maintain a linear Git history.