Skip to content

docs(litellm-rust): require the official Rust Style Guide in agent rules - #33867

Merged
ishaan-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_rust_style_guide_rules
Jul 18, 2026
Merged

docs(litellm-rust): require the official Rust Style Guide in agent rules#33867
ishaan-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_rust_style_guide_rules

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests (docs-only; no code change)
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

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 reads AGENTS.md, Claude reads CLAUDE.md, Devin reads both), so the rule is added to both litellm-rust/AGENTS.md and litellm-rust/CLAUDE.md

The mechanical half is already enforced: rustfmt implements the guide's formatting by default and CI (test-rust.yml) gates every PR on cargo fmt --check, so the added text makes that expectation explicit (run cargo fmt; don't add a divergent rustfmt.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.md carries the detailed version; AGENTS.md carries a self-contained summary so Codex picks it up without needing to read CLAUDE.md

No code changes and no rustfmt.toml added, so the default rustfmt style (which is the guide) stays the single source of truth

Link to Devin session: https://app.devin.ai/sessions/cc85797551a7458a918eba9d693c9f4a
Requested by: @ishaan-berri

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
@ishaan-berri ishaan-berri self-assigned this Jul 18, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ishaan-berri
ishaan-berri enabled auto-merge (squash) July 18, 2026 22:22
@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This docs-only PR adds Rust Style Guide enforcement rules to both litellm-rust/AGENTS.md (for Codex/Devin) and litellm-rust/CLAUDE.md (for Claude), making the cargo fmt requirement, naming conventions, and import ordering explicit for all three AI coding tools.

  • AGENTS.md: Adds a concise "Style" section with the style guide URL, cargo fmt instructions, and a one-line summary of naming rules; points to CLAUDE.md for the full version.
  • CLAUDE.md: Adds a detailed "Rust Style Guide" section covering formatting enforcement, naming conventions (snake_case / UpperCamelCase / SCREAMING_SNAKE_CASE), import grouping, and idiomatic expression preferences — all accurate and consistent with the official guide.

Confidence Score: 4/5

Safe 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.

Important Files Changed

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

Comment thread litellm-rust/AGENTS.md

`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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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!

@ishaan-berri
ishaan-berri merged commit 9dfd79b into litellm_internal_staging Jul 18, 2026
76 checks passed
@ishaan-berri
ishaan-berri deleted the litellm_rust_style_guide_rules branch July 18, 2026 22:25
@codspeed-hq

codspeed-hq Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_rust_style_guide_rules (8e286ad) with litellm_internal_staging (e238e89)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (3f9b71c) during the generation of this report, so e238e89 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants