diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bca127bb0..6438e8b87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -102,6 +102,46 @@ cargo run -- venv cargo run -- pip install requests ``` +## Formatting + +```shell +# Rust +cargo fmt --all + +# Python +uvx ruff format . + +# Markdown, YAML, and other files (requires Node.js) +npx prettier --write . +# or in Docker +docker run --rm -v .:/src/ -w /src/ node:alpine npx prettier --write . +``` + +## Linting + +Linting requires [shellcheck](https://github.com/koalaman/shellcheck) and +[cargo-shear](https://github.com/Boshen/cargo-shear) to be installed separately. + +```shell +# Rust +cargo clippy --workspace --all-targets --all-features --locked -- -D warnings + +# Python +uvx ruff check . + +# Python type checking +uvx ty check python/uv + +# Shell scripts +shellcheck