docs: clarify STYLE.md (#910)

For error messages: use proper abbreviation casing, e.g., IPv4 and IPv6
(not ipv4/ipv6).

For inline comments, no period for brief comments
(e.g., `// VER`, `// RSV`, `// ATYP`)
This commit is contained in:
Benoît Cortier 2025-08-05 05:12:59 -04:00 committed by GitHub
parent 166b76010c
commit 867ed221da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,6 +79,8 @@ This is the convention adopted by the Rust project:
- [Rust API Guidelines][api-guidelines-errors] - [Rust API Guidelines][api-guidelines-errors]
- [std::error::Error][std-error-trait] - [std::error::Error][std-error-trait]
Also, use proper abbreviation casing, e.g., IPv4 and IPv6 (not ipv4/ipv6).
```rust ```rust
// GOOD // GOOD
"invalid X.509 certificate" "invalid X.509 certificate"
@ -278,6 +280,8 @@ let artifact_name = format!("{}.wasm", package.replace('-', "_"));
**Rationale:** writing a sentence (or maybe even a paragraph) rather just "a comment" creates a more appropriate frame of mind. **Rationale:** writing a sentence (or maybe even a paragraph) rather just "a comment" creates a more appropriate frame of mind.
It tricks you into writing down more of the context you keep in your head while coding. It tricks you into writing down more of the context you keep in your head while coding.
Exception: no period for brief comments (e.g., `// VER`, `// RSV`, `// ATYP`)
### "Sentence per line" style ### "Sentence per line" style
For `.md` and `.adoc` files, prefer a sentence-per-line format, don't wrap lines. For `.md` and `.adoc` files, prefer a sentence-per-line format, don't wrap lines.