Skip to content

docs(guide/dev): remove generic and compiler-enforced sections#358

Merged
KSXGitHub merged 3 commits into
masterfrom
remove-some-parts-of-contribution-guide
Mar 18, 2026
Merged

docs(guide/dev): remove generic and compiler-enforced sections#358
KSXGitHub merged 3 commits into
masterfrom
remove-some-parts-of-contribution-guide

Conversation

@KSXGitHub

@KSXGitHub KSXGitHub commented Mar 18, 2026

Copy link
Copy Markdown
Owner

Keep the contributing guide focused on conventions unique to this project rather than restating standard Rust practices or compiler-enforced rules.

Removed from CONTRIBUTING.md:

  • #[non_exhaustive] requirement from error enum guidelines
  • "Documentation Comments" section (standard Rust practice)
  • "Feature Gating" section (standard Rust practice)
  • "Warnings Policy" section (#![deny(warnings)] is self-enforcing)
  • "Visibility" section (pub/pub(crate) is basic Rust knowledge)
  • "Struct Field Ordering" section (subjective, not project-specific)
  • "Macros" section (generic advice)
  • Type alias pub use ... as ... example
  • "Use exhaustive matching" instruction (compiler-enforced)

Updated CLAUDE.md, AGENTS.md, and copilot-instructions.md to match:

  • Removed #[non_exhaustive] from custom errors line
  • Removed #![deny(warnings)] line

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown

Performance Regression Reports

commit: d77805c

There are no regressions.

KSXGitHub pushed a commit that referenced this pull request Mar 18, 2026
Remove `#[non_exhaustive]` from custom errors bullet and remove
`#![deny(warnings)]` bullet, matching the removals in PR #358.

https://claude.ai/code/session_012rU7VAeZADzFWewCEUMMyG
@KSXGitHub KSXGitHub requested a review from Copilot March 18, 2026 03:29

Copilot AI 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.

Pull request overview

Updates the repository’s contribution guidelines by removing/condensing several style-policy sections in CONTRIBUTING.md.

Changes:

  • Removes the explicit guideline to mark custom error enums as #[non_exhaustive].
  • Removes the “Documentation Comments”, “Feature Gating”, and “Warnings Policy” sections.
  • Tweaks the “Pattern Matching” section wording/formatting.
Comments suppressed due to low confidence (1)

CONTRIBUTING.md:219

  • The Error Handling section no longer mentions marking custom error enums as #[non_exhaustive], but the example immediately below still uses #[non_exhaustive]. This is internally inconsistent for contributors; either restore the guideline bullet or remove/update the example so the guidance and sample code agree.
### Error Handling

- Define custom error enums with `#[derive(Debug, Display, Error)]` from `derive_more`.
- Minimize `unwrap()` in non-test code — use proper error propagation. `unwrap()` is acceptable in tests and for provably infallible operations (with a comment explaining why). When deliberately ignoring an error, use `.ok()` with a comment explaining why.

```rust
#[derive(Debug, Display, Error)]
#[non_exhaustive]
pub enum RuntimeError {

You can also share your feedback on Copilot code review. Take the survey.

Comment thread CONTRIBUTING.md Outdated
Remove `#[non_exhaustive]` from custom errors bullet and remove
`#![deny(warnings)]` bullet, matching the removals in PR #358.

https://claude.ai/code/session_012rU7VAeZADzFWewCEUMMyG

Co-authored-by: Claude <noreply@anthropic.com>

This comment was marked as resolved.

Remove Visibility, Struct Field Ordering, Macros, and `pub use ... as`
bullet — these are either standard Rust knowledge, generic best practices,
or not used in the codebase.

https://claude.ai/code/session_01VE5W68ky3UobBMongN8Dfc

Co-authored-by: Claude <noreply@anthropic.com>
@KSXGitHub KSXGitHub requested a review from Copilot March 18, 2026 04:15
@KSXGitHub KSXGitHub changed the title docs(guide/dev): remove some sections docs(guide/dev): remove generic and compiler-enforced sections Mar 18, 2026

Copilot AI 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.

Pull request overview

This PR updates the repository’s contribution and agent instruction documentation by removing several previously documented style/policy guidelines (e.g., visibility rules, warnings policy, documentation comment rules) and simplifying the “custom errors” guidance.

Changes:

  • Removed multiple sections from CONTRIBUTING.md (visibility, documentation comments, feature gating, struct field ordering, macros, warnings policy).
  • Updated agent instruction docs (CLAUDE.md, AGENTS.md, .github/copilot-instructions.md) to drop #[non_exhaustive] and #![deny(warnings)] mentions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
CONTRIBUTING.md Removes several documented conventions and simplifies error-handling guidance.
CLAUDE.md Updates the “Quick Reference” rules for agents (notably custom errors and warnings policy).
AGENTS.md Same “Quick Reference” updates as CLAUDE.md.
.github/copilot-instructions.md Same “Quick Reference” updates as CLAUDE.md, for Copilot instructions.
Comments suppressed due to low confidence (2)

CONTRIBUTING.md:207

  • The Error Handling section no longer mentions #[non_exhaustive], but the example immediately below still includes #[non_exhaustive] (and the codebase uses it widely). This is internally inconsistent—either re-add the guideline, or remove/update the example (and any related guidance) so the section is self-consistent.
### Error Handling

- Define custom error enums with `#[derive(Debug, Display, Error)]` from `derive_more`.
- Minimize `unwrap()` in non-test code — use proper error propagation. `unwrap()` is acceptable in tests and for provably infallible operations (with a comment explaining why). When deliberately ignoring an error, use `.ok()` with a comment explaining why.

```rust
#[derive(Debug, Display, Error)]
#[non_exhaustive]
pub enum RuntimeError {

CONTRIBUTING.md:231

  • This document removed the Warnings Policy note, but the crate still has #![deny(warnings)] (see src/lib.rs:6). Contributors will still hit warning-as-error failures; please reintroduce a brief note here (or point to where this policy is documented) so CONTRIBUTING matches actual build behavior.
## Setup

Install the required Rust toolchain and components before running any checks:

```sh
rustup toolchain install "$(< rust-toolchain)"
rustup component add --toolchain "$(< rust-toolchain)" rustfmt clippy
</details>



---

You can also share your feedback on Copilot code review. [Take the survey](https://www.surveymonkey.com/r/XP6L3XJ).

Comment thread CLAUDE.md
Comment thread CLAUDE.md
Comment thread AGENTS.md
Comment thread AGENTS.md
Comment thread .github/copilot-instructions.md
Comment thread .github/copilot-instructions.md
@KSXGitHub KSXGitHub marked this pull request as ready for review March 18, 2026 04:20
@KSXGitHub KSXGitHub merged commit 291f43d into master Mar 18, 2026
17 checks passed
@KSXGitHub KSXGitHub deleted the remove-some-parts-of-contribution-guide branch March 18, 2026 04:20
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