docs(litellm-rust): require the official Rust Style Guide in agent rules - #33867
Conversation
Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryThis docs-only PR adds Rust Style Guide enforcement rules to both
Confidence Score: 4/5Safe to merge; changes are documentation-only and do not touch any runtime code. Both files correctly describe the Rust Style Guide requirements. The only issue is a misleading example in AGENTS.md where the HttpClient acronym example is parenthetically attached to the SCREAMING_SNAKE_CASE clause instead of applying to all conventions — an AI agent could misread it. CLAUDE.md states this correctly and can serve as ground truth. litellm-rust/AGENTS.md — the naming-convention line has a misleading example placement that a suggestion comment addresses.
|
| Filename | Overview |
|---|---|
| litellm-rust/AGENTS.md | Adds a 'Style' section documenting the Rust Style Guide requirement; contains a minor but misleading placement of the UpperCamelCase example under the SCREAMING_SNAKE_CASE rule. |
| litellm-rust/CLAUDE.md | Adds a well-structured 'Rust Style Guide' section with accurate naming conventions, import grouping rules, and cargo fmt instructions; content is correct and consistent with the official guide. |
Reviews (1): Last reviewed commit: "docs(litellm-rust): require the official..." | Re-trigger Greptile
|
|
||
| `rustfmt` implements its formatting by default, so run `cargo fmt` before committing; CI gates every PR on `cargo fmt --check`. Do not hand-format against rustfmt or add a `rustfmt.toml` that diverges from the default style. | ||
|
|
||
| Beyond formatting, follow the guide's naming and idiom conventions rustfmt cannot auto-apply: `snake_case` items/functions/modules, `UpperCamelCase` types/traits/variants, `SCREAMING_SNAKE_CASE` constants/statics (acronyms as one word, e.g. `HttpClient`), and the import grouping and item ordering it prescribes. See CLAUDE.md for the detailed version. |
There was a problem hiding this comment.
The acronym example
HttpClient is UpperCamelCase, not SCREAMING_SNAKE_CASE, so attaching it to the constants/statics clause is misleading — an AI agent reading this could infer that HTTPCLIENT is a valid constant name. CLAUDE.md handles this correctly by stating the acronym rule separately after all three conventions. Aligning AGENTS.md with that phrasing removes the ambiguity.
| Beyond formatting, follow the guide's naming and idiom conventions rustfmt cannot auto-apply: `snake_case` items/functions/modules, `UpperCamelCase` types/traits/variants, `SCREAMING_SNAKE_CASE` constants/statics (acronyms as one word, e.g. `HttpClient`), and the import grouping and item ordering it prescribes. See CLAUDE.md for the detailed version. | |
| Beyond formatting, follow the guide's naming and idiom conventions rustfmt cannot auto-apply: `snake_case` items/functions/modules, `UpperCamelCase` types/traits/variants, `SCREAMING_SNAKE_CASE` constants/statics; acronyms count as one word across all conventions (e.g. `HttpClient`, not `HTTPClient`). Follow the import grouping and item ordering the guide prescribes. See CLAUDE.md for the detailed version. |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Relevant issues
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Docs-only change to the agent rules files; no runtime behavior, so there is nothing to curl. N/A
Type
📖 Documentation
Changes
We want Claude, Codex, and Devin to all follow the official Rust Style Guide (https://doc.rust-lang.org/style-guide/) for anything under
litellm-rust/. The three tools read different rules files (Codex readsAGENTS.md, Claude readsCLAUDE.md, Devin reads both), so the rule is added to bothlitellm-rust/AGENTS.mdandlitellm-rust/CLAUDE.mdThe mechanical half is already enforced: rustfmt implements the guide's formatting by default and CI (
test-rust.yml) gates every PR oncargo fmt --check, so the added text makes that expectation explicit (runcargo fmt; don't add a divergentrustfmt.toml) and additionally spells out the naming and idiom conventions rustfmt cannot auto-apply (snake_case/UpperCamelCase/SCREAMING_SNAKE_CASE, acronyms as one word, import grouping and item ordering).CLAUDE.mdcarries the detailed version;AGENTS.mdcarries a self-contained summary so Codex picks it up without needing to readCLAUDE.mdNo code changes and no
rustfmt.tomladded, so the default rustfmt style (which is the guide) stays the single source of truthLink to Devin session: https://app.devin.ai/sessions/cc85797551a7458a918eba9d693c9f4a
Requested by: @ishaan-berri