From 9ea3466abaac5a38661f3e018e70d16233de459f Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 14 Jan 2026 12:18:42 -0600 Subject: [PATCH] Add linting and formatting instructions to the CONTRIBUTING guide (#17470) I noticed these were missing. Co-authored-by: Claude --- CONTRIBUTING.md | 53 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 12 deletions(-) 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