mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: persist Error-message style in CONTRIBUTING.md and AGENTS.md
In [0] we agreed on the current format. [0] https://github.com/cloud-hypervisor/cloud-hypervisor/pull/7066 On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Bo Chen
parent
252702049e
commit
9ba653dc16
@@ -31,6 +31,11 @@ reviewable, and compatible with the project's normal engineering constraints.
|
||||
migration implications.
|
||||
- Do not invent APIs, behavior, or requirements. If something is uncertain,
|
||||
state the uncertainty and proceed only with minimal, explicit assumptions.
|
||||
- For `thiserror`-style errors, start messages with a capital letter and keep
|
||||
the outer `Display` text short. Put all non-`#[source]` attributes in the
|
||||
message to improve helpfulness, but do not repeat a `#[source]` value
|
||||
inline: Cloud Hypervisor prints the full error chain, so only include the
|
||||
concrete failure text directly when there is no source to report.
|
||||
|
||||
### Safety and Domain Notes
|
||||
|
||||
|
||||
@@ -44,6 +44,12 @@ state changes that matter in production; use `warn!` or `error!` only for
|
||||
abnormal conditions. Keep `debug!` for focused diagnostics. Please find more
|
||||
information in [`docs/logging.md`](docs/logging.md).
|
||||
|
||||
Error messages should be sentence-style: start with a capital letter and stay
|
||||
concise. For `thiserror`-style errors, put all non-`#[source]` attributes
|
||||
(if they provide clear value) in the outer `Display` text to improve helpfulness,
|
||||
but do not repeat a `#[source]` value there because Cloud Hypervisor prints the
|
||||
full chain elsewhere.
|
||||
|
||||
[Rust Style]: https://github.com/rust-lang/rust/tree/HEAD/src/doc/style-guide/src
|
||||
|
||||
## Basic Checks
|
||||
|
||||
Reference in New Issue
Block a user