Your coding style should follow the official rust style guide.
rustfmt
should be activated with it's default settings.- If available use
Even Better TOML
formatter.
- Errors should, when available be wrapped with
CalError
before returning.- Make use of
CalErrorKind
categories. - The source error should be wrapped into an
anyhow::Error
and be set as source. - Errors should be logged with
tracing::error!()
right where they are first seen. - Structured logging should always be preffered:
tracing::error!(error=the_error_Im_logging, "My error message")
✔️ - Do not log
CalError
as debug print:tracing::error!("{:?}", the_error_Im_logging)
❌ - Consider using
#[tracing::instrument(level = "trace")]
for complex functions. - Consider using
#[tracing::instrument]
for important functions, likedelete()
. - Never log secrets!. Skip secrets:
#[instrument(skip(secret1, secret2))]
or#[instrument(skip_all)]
- Make use of
Commits must follow Conventional Commits guidelines.
Branch names must adhere to the following schme: the-operation/the-thing-being-worked-on
feature/structured-error-logging
fix/program-crash-on-second-provider-creation
A PR should have a good description of what has been added, changed and removed. Examples might be usefull.
Before merging a PR go over the checklist.
The examples should cover the core use cases of the library.
The README of the subprojects should describe how to build and test the subprojects.