8000 Added Rust coding standards to CLAUDE.md by evanspearman · Pull Request #215 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

Added Rust coding standards to CLAUDE.md - #215

Merged
evanspearman merged 1 commit into
mainfrom
evan/rust-standards
May 22, 2026
Merged

evanspearman merged 1 commit into
mainfrom
evan/rust-standards

Conversation

@evanspearman
@evanspearman evanspearman commented May 21, 2026 •
Copy link
Copy Markdown
Member

Added some Rust coding standards for agents to CLAUDE.md to see if we can improve the quality of the Rust code it generates.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Rust coding standards guidance covering functional style, common idioms, error-handling patterns, async/concurrency approaches, logging best practices, testing and linting expectations, dependency/version pinning, and other repository-wide development practices to standardize contributions and code quality.

Review Change Stack

@coderabbitai
coderabbitai Bot commented May 21, 2026 •
Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74df2ccf-aca0-477c-a411-8b717788cbe2

📥 Commits

Reviewing files that changed from the base of the PR and between a96331a and 26b9187.

📒 Files selected for processing (1)
  • CLAUDE.md
✅ Files skipped from review due to trivial changes (1)
  • CLAUDE.md

📝 Walkthrough

Walkthrough

CLAUDE.md is updated with a new "Rust Coding Standards" section detailing repository-wide conventions for functional programming style, error handling, async/concurrency patterns, tracing-based logging, and general practices including testing and dependency management.

Changes

Rust Coding Standards Documentation

Layer / File(s) Summary
Rust Coding Standards guidance
CLAUDE.md
A comprehensive "Rust Coding Standards" section documents repository conventions across functional style, idiomatic Rust, error handling, async/concurrency, logging via tracing, and general practices for testing, clippy compliance, and dependency pinning.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A guidance scroll unfurled so bright,
With Rust conventions penned in light,
From async hops to logging trace,
Clean code hops through every place,
A rabbit's nod to tidy byte!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Added Rust coding standards to CLAUDE.md' accurately describes the main change in the pull request, which is adding a new 'Rust Coding Standards' guidance section to the CLAUDE.md documentation file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment
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.

🧹 Nitpick comments (1)
CLAUDE.md (1)

144-144: ⚡ Quick win

Unify clippy/test command guidance across the document.

This line conflicts with the earlier Development Commands section (cargo clippy --allow-dirty --fix ...). Please make one canonical command set (or explicitly split “local auto-fix” vs “CI/strict check”) so agents don’t follow conflicting workflows.

Based on learnings: Run cargo clippy --all-targets -- -D warnings and cargo test for every Rust change; justify any #[allow(...)] with a comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` at line 144, Update CLAUDE.md to remove the conflicting
clippy/test guidance by choosing a single canonical command set (or explicitly
labeling two workflows "local auto-fix" vs "CI/strict") and make both
occurrences consistent: replace the earlier `cargo clippy --allow-dirty --fix
...` guidance and the later `cargo clippy --all-targets -- -D warnings` line so
they either both document the local auto-fix flow (e.g., `cargo clippy
--allow-dirty --fix --all-targets` plus `cargo test`) and a separate CI/strict
command (`cargo clippy --all-targets -- -D warnings` and `cargo test`), or
consolidate to the single strict pair `cargo clippy --all-targets -- -D
warnings` and `cargo test`; also keep the instruction to justify any
`#[allow(...)]` with a comment and ensure both places mention that
justification.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@CLAUDE.md`:
- Line 144: Update CLAUDE.md to remove the conflicting clippy/test guidance by
choosing a single canonical command set (or explicitly labeling two workflows
"local auto-fix" vs "CI/strict") and make both occurrences consistent: replace
the earlier `cargo clippy --allow-dirty --fix ...` guidance and the later `cargo
clippy --all-targets -- -D warnings` line so they either both document the local
auto-fix flow (e.g., `cargo clippy --allow-dirty --fix --all-targets` plus
`cargo test`) and a separate CI/strict command (`cargo clippy --all-targets --
-D warnings` and `cargo test`), or consolidate to the single strict pair `cargo
clippy --all-targets -- -D warnings` and `cargo test`; also keep the instruction
to justify any `#[allow(...)]` with a comment and ensure both places mention
that justification.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 932fef2e-3ea3-4bd4-af55-8ed6dedf3ba3

📥 Commits

Reviewing files that changed from the base of the PR and between 304c886 and a96331a.

📒 Files selected for processing (1)
  • CLAUDE.md

Comment thread CLAUDE.md Outdated

### Error Handling

- Library crates: typed error enum via thiserror. Variants are distinct failure modes; carry source via #[from] / #[source].
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.

thiserror over manual impls? Not sure whats right here but ive always leaned to the latter 😅

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The #[from] macro is really nice in thiserror. I don't feel that strongly about using it though. Is there a reason we want to avoid it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed it for now. Better to not couple that sort of decision with this.

@norrietaylor
Copy link
Copy Markdown
Member

Just a comment, no action needed.

At some point we probably want to break out some the sections in this doc into reusable, referenceable fragments. This way we can be a little more precise about when we inject them them into the context window.

On top of that reusability is just good no matter what.

@evanspearman
evanspearman force-pushed the evan/rust-standards branch from a96331a to 26b9187 Compare May 22, 2026 15:16
@evanspearman
evanspearman merged commit 48a3f0e into main May 22, 2026
8 checks passed
@evanspearman
evanspearman deleted the evan/rust-standards branch May 22, 2026 15:53
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.

3 participants

0