Skip to content

Commit 291f43d

Browse files
KSXGitHubclaude
andauthored
docs(guide/dev): remove generic and compiler-enforced sections (#358)
Keep the contributing guide focused on conventions unique to this project rather than restating standard Rust practices or compiler-enforced rules. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ee5ddc0 commit 291f43d

4 files changed

Lines changed: 4 additions & 45 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Read and follow the CONTRIBUTING.md file in this repository for all code style c
1111
- Use descriptive variable and closure parameter names by default — single letters are only allowed in: conventional names (`n` for count, `f` for formatter), comparison closures (`|a, b|`), trivial single-expression closures, fold accumulators, index variables (`i`/`j`/`k` in short closures or index-based loops only), and test fixtures (identical roles only). Never use single letters in multi-line functions or closures
1212
- Prefer `where` clauses for multiple trait bounds
1313
- Derive order: std traits → comparison traits → `Hash` → derive_more → feature-gated
14-
- Custom errors: `#[derive(Debug, Display, Error)]` + `#[non_exhaustive]`
14+
- Custom errors: `#[derive(Debug, Display, Error)]`
1515
- Minimize `unwrap()` in non-test code — use proper error handling
16-
- `#![deny(warnings)]` is active — code must be warning-free
1716
- Install toolchain before running tests: `rustup toolchain install "$(< rust-toolchain)" && rustup component add --toolchain "$(< rust-toolchain)" rustfmt clippy`
1817
- If the AI agent is Claude Code, `gh` (GitHub CLI) is not installed — do not attempt to use it
1918
- Run `FMT=true LINT=true BUILD=true TEST=true DOC=true ./test.sh` to validate changes

AGENTS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Read and follow the CONTRIBUTING.md file in this repository for all code style c
1111
- Use descriptive variable and closure parameter names by default — single letters are only allowed in: conventional names (`n` for count, `f` for formatter), comparison closures (`|a, b|`), trivial single-expression closures, fold accumulators, index variables (`i`/`j`/`k` in short closures or index-based loops only), and test fixtures (identical roles only). Never use single letters in multi-line functions or closures
1212
- Prefer `where` clauses for multiple trait bounds
1313
- Derive order: std traits → comparison traits → `Hash` → derive_more → feature-gated
14-
- Custom errors: `#[derive(Debug, Display, Error)]` + `#[non_exhaustive]`
14+
- Custom errors: `#[derive(Debug, Display, Error)]`
1515
- Minimize `unwrap()` in non-test code — use proper error handling
16-
- `#![deny(warnings)]` is active — code must be warning-free
1716
- Install toolchain before running tests: `rustup toolchain install "$(< rust-toolchain)" && rustup component add --toolchain "$(< rust-toolchain)" rustfmt clippy`
1817
- If the AI agent is Claude Code, `gh` (GitHub CLI) is not installed — do not attempt to use it
1918
- Run `FMT=true LINT=true BUILD=true TEST=true DOC=true ./test.sh` to validate changes

CLAUDE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Read and follow the CONTRIBUTING.md file in this repository for all code style c
1111
- Use descriptive variable and closure parameter names by default — single letters are only allowed in: conventional names (`n` for count, `f` for formatter), comparison closures (`|a, b|`), trivial single-expression closures, fold accumulators, index variables (`i`/`j`/`k` in short closures or index-based loops only), and test fixtures (identical roles only). Never use single letters in multi-line functions or closures
1212
- Prefer `where` clauses for multiple trait bounds
1313
- Derive order: std traits → comparison traits → `Hash` → derive_more → feature-gated
14-
- Custom errors: `#[derive(Debug, Display, Error)]` + `#[non_exhaustive]`
14+
- Custom errors: `#[derive(Debug, Display, Error)]`
1515
- Minimize `unwrap()` in non-test code — use proper error handling
16-
- `#![deny(warnings)]` is active — code must be warning-free
1716
- Install toolchain before running tests: `rustup toolchain install "$(< rust-toolchain)" && rustup component add --toolchain "$(< rust-toolchain)" rustfmt clippy`
1817
- If the AI agent is Claude Code, `gh` (GitHub CLI) is not installed — do not attempt to use it
1918
- Run `FMT=true LINT=true BUILD=true TEST=true DOC=true ./test.sh` to validate changes

CONTRIBUTING.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ pub use error_report::ErrorReport;
6464
pub use event::Event;
6565
```
6666

67-
- Type aliases using `pub use ... as ...` are used to provide semantic alternative names:
68-
69-
```rust
70-
pub use Reflection as DataTreeReflection;
71-
```
72-
7367
### Derive Macro Ordering
7468

7569
When deriving multiple traits, use this order and split across multiple `#[derive(...)]` lines for readability:
@@ -202,16 +196,9 @@ where
202196
HardlinksRecorder: RecordHardlinks<Size, Report> + Sync + ?Sized,
203197
```
204198

205-
### Visibility
206-
207-
- Use `pub` for the public API surface.
208-
- Use `pub(crate)` for items shared within the crate but not exposed externally.
209-
- Default to private for everything else.
210-
211199
### Error Handling
212200

213201
- Define custom error enums with `#[derive(Debug, Display, Error)]` from `derive_more`.
214-
- Mark error enums as `#[non_exhaustive]`.
215202
- 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.
216203

217204
```rust
@@ -223,22 +210,9 @@ pub enum RuntimeError {
223210
}
224211
```
225212

226-
### Documentation Comments
227-
228-
- Use `///` doc comments for all public types, traits, functions, and fields.
229-
- Use `//!` module-level doc comments at the top of `lib.rs` and significant modules.
230-
- Include usage examples with `/// ```no_run` blocks for key public APIs.
231-
- Reference related types with `[`backtick links`](crate::path)` syntax.
232-
233-
### Feature Gating
234-
235-
- Use `#[cfg(feature = "...")]` for optional functionality (e.g., `json`, `cli`).
236-
- Use `#[cfg(unix)]` for POSIX-specific code.
237-
- Use `#[cfg_attr(feature = "json", derive(Deserialize, Serialize))]` for conditional derives.
238-
239213
### Pattern Matching
240214

241-
Use exhaustive matching. When mapping enum variants to values, prefer the concise wrapping style:
215+
When mapping enum variants to values, prefer the concise wrapping style:
242216

243217
```rust
244218
ExitCode::from(match self {
@@ -247,18 +221,6 @@ ExitCode::from(match self {
247221
})
248222
```
249223

250-
### Struct Field Ordering
251-
252-
Order fields logically by purpose, not alphabetically. Group related fields together. Document every public field with `///` comments.
253-
254-
### Macros
255-
256-
Use macros to reduce boilerplate for repetitive patterns (e.g. newtype wrappers, trait impls for multiple numeric types). Keep macros well-scoped and documented.
257-
258-
### Warnings Policy
259-
260-
The crate uses `#![deny(warnings)]` — all warnings are treated as errors. Code must compile warning-free.
261-
262224
## Setup
263225

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

0 commit comments

Comments
 (0)