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

Linting and formatting

Lesshand uses several code linters and formatters.

Format

Rust

Rust code formatted with rustfmt. You can install rustfmt with rustup like so:

rustup component add rustfmt

and then run it like this:

cargo fmt --all

Python

Python code formatted with ruff.

ruff format ./**/*.py

Lint

Rust

All code should pass Clippy. You can install Clippy with rustup like so:

rustup component add clippy

and then run it like this:

cargo clippy --workspace -- --deny warnings

Python

Python code linted with ruff.

ruff check ./**/*.py

Markdown

We run typos on the README and doc/ to spell-check the documentation. To run it locally, try:

typos README.md doc/