apache / apache/iggy

docs: add coding guidelines for the rust code

Open
#4,082 0 comments 0 reactions 1 assignee Claimed by @hubcio View on GitHub
docs rust
Dominant language
Rust
Stars
4.9k
Forks
432
Avg merge
2d 10h
Merged PRs (30d)
173

Description

The aim of this is to create one doc at the repo root, `CODING_GUIDELINES.md`, rust only.
foreign sdks keep the lint sections they already have in `foreign//README.md`,
the doc links to them in one line.

the rules live in two places today and they already drift. `AGENTS.md` has a 14 item
"repo-wide principles" list, `CONTRIBUTING.md` has a "code style" section, and they
overlap. example: `CONTRIBUTING.md` says `cargo sort --workspace`, `AGENTS.md` says
`--no-format` is mandatory. reviewers repeat the same comments in every pr because
there is no single page to point at.

## Scope

style and clean code rules for rust: naming, comments (why, not what), module and
file layout, error handling, unsafe, locks and async, allocation in hot paths, test
naming, dependencies, commit format. the exact rules get worked out in the pr, this
issue only tracks that the doc exists and is the single source.

## After it lands

- `CONTRIBUTING.md` trims its "code style" section to a link
- `AGENTS.md` trims "repo-wide principles" to a link, keeps the agent only items
(stop and ask list, never `cargo install`)

## Checklist

- [ ] write `CODING_GUIDELINES.md`
- [ ] link it from `CONTRIBUTING.md`
- [ ] link it from `AGENTS.md`
- [ ] remove the duplicated rules from both

Issue created due to comment https://github.com/apache/iggy/pull/4081/changes#r3945770269

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.