improve documentation section#13274
improve documentation section#13274ShahakShama wants to merge 1 commit intoshahak/style-guide-remove-track-callerfrom
Conversation
27317f1 to
e4c1846
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
3c533d0 to
3919551
Compare
e4c1846 to
27d38ff
Compare
Stavbe
left a comment
There was a problem hiding this comment.
is this --- do something or it is just an AI footprint
@Stavbe made 10 comments.
Reviewable status: 0 of 1 files reviewed, 9 unresolved discussions (waiting on ShahakShama).
style.md line 368 at r2 (raw file):
## Documentation Make sure every struct, enum, member, function, method and enum variant that's part of the API is documented --- Unless there's nothing to add that the name didn't cover
,
Code quote:
---style.md line 370 at r2 (raw file):
Make sure every struct, enum, member, function, method and enum variant that's part of the API is documented --- Unless there's nothing to add that the name didn't cover Use `///` to document the API --- for the user.
remove
Code quote:
--- for the user.style.md line 372 at r2 (raw file):
Use `///` to document the API --- for the user. Use `//` to explain how the code works --- for someone reading the internal implementation.
removeb
Code quote:
---style.md line 376 at r2 (raw file):
Don't use `/* */` - style comments. If you want to use an abbreviation (e.g. `tx` for `transaction`) or acronym (e.g. `ABI` for `Application Binary Interface`), introduce it in the documentation of the struct/enum the abbreviation/acronym shortens.
Do we want people to write tx = transaction in the enum definition ? It is weird... maybe -make sure the fielde documented with the "full" word.
style.md line 388 at r2 (raw file):
Take extra care when using AI-generated code, which tends to include a lot of trivial comment-bloat. **Rationale**: clear code is self-documenting; repeating it wastes the reader's time and adds maintenance burden, as the comment can drift out of sync with the code it describes.
I think we want to avoid this, say, because we want to encourage people to do.
Code quote:
**Rationale**: clear code is self-documenting; repeating it wastes the reader's time and adds maintenance burden, as the comment can drift out of sync with the code it describes.style.md line 397 at r2 (raw file):
// BAD - Restates the function signature. /// Returns the user's name. fn user_name(&self) -> &str { ... }
I think this bsd needs to be removed because we encourage documenting also "obvious" functions.
Code quote:
// BAD - Restates the function signature.
/// Returns the user's name.
fn user_name(&self) -> &str { ... }style.md line 405 at r2 (raw file):
However, a comment that gives a title to a paragraph of code is useful --- it tells the reader what the block achieves so they can skim or skip it.
remove
Code quote:
---style.md line 423 at r2 (raw file):
When you find yourself adding such a title comment, consider extracting the paragraph into a helper function where it makes sense --- the function name then serves as the documentation.
remove
Code quote:
--- the function name then serves as the documentation.3919551 to
4f1503e
Compare
27d38ff to
2e9fc25
Compare
4f1503e to
dcc3953
Compare
2e9fc25 to
d8464ca
Compare
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 7 comments.
Reviewable status: 0 of 1 files reviewed, 8 unresolved discussions (waiting on Stavbe).
style.md line 370 at r2 (raw file):
Previously, Stavbe wrote…
remove
I like the for the user section. Changed to parentheses
style.md line 372 at r2 (raw file):
Previously, Stavbe wrote…
removeb
Done.
style.md line 376 at r2 (raw file):
Previously, Stavbe wrote…
Do we want people to write tx = transaction in the enum definition ? It is weird... maybe -make sure the fielde documented with the "full" word.
I mainly thought of the acronym section when writing this. how's this now?
style.md line 388 at r2 (raw file):
Previously, Stavbe wrote…
I think we want to avoid this, say, because we want to encourage people to do.
I disagree. Lior also said that this rationale is true. If you want we can bring this to discussion
style.md line 397 at r2 (raw file):
Previously, Stavbe wrote…
I think this bsd needs to be removed because we encourage documenting also "obvious" functions.
I disagree. I also wrote this at the top of the documentation section (Unless there's nothing to add that the name didn't cover)
style.md line 405 at r2 (raw file):
Previously, Stavbe wrote…
remove
I do want a non-comma separator. How's this?
style.md line 423 at r2 (raw file):
Previously, Stavbe wrote…
remove
Done.
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 1 comment.
Reviewable status: 0 of 1 files reviewed, 8 unresolved discussions (waiting on Stavbe).
style.md line 368 at r2 (raw file):
Previously, Stavbe wrote…
,
Done.
d8464ca to
9424c4e
Compare
9424c4e to
d796251
Compare
Stavbe
left a comment
There was a problem hiding this comment.
@Stavbe made 1 comment and resolved 6 discussions.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on ShahakShama).
style.md line 379 at r4 (raw file):
### Abbreviations and Acronyms Abbreviations (e.g. `tx` for `transaction`) are allowed only in variables, function arguments and function names. Prefer to avoid them in function names if possible.
This is confusing. It is always possible. Let's choose yes or no- I vote for yes.
Code quote:
and function names. Prefer to avoid them in function names if possible.

Note
Low Risk
Documentation-only edits to the coding conventions; no runtime or behavioral code changes.
Overview
Updates
style.md's documentation guidance by renaming the section to## Documentationand clarifying the split between API docs (///) vs implementation comments (//).Adds explicit rules for abbreviations vs acronyms in identifiers/docs, and expands the "trivial comments" guidance with stronger rationale plus new examples showing restatement vs "why" comments and when a short block-summary comment is acceptable (with a suggestion to extract helpers instead).
Written by Cursor Bugbot for commit d796251. This will update automatically on new commits. Configure here.