This document is a work-in-progress.
When creating a bug report, start by checking for similar bugs, even if they are closed. Closed issues may contain the solution to your problem.
If the same issue was reported and closed due to lack of information, add your information to the existing issue and it will get reopened for further review.
If no similar issues exist, create a new one with the following information:
hoard
version (commit if built from git).- Steps to reproduce the issue.
- A minimal configuration file that causes the issue to be reproduceable.
- If the issue is not a crash or obvious error, a short description of what the expected behavior is.
This information will make it much easier for me to be able to help resolve your issue.
When submitting a feature request, first check the issue tracker for similar requests.
- If one exists and is open, add a thumbs up, heart, or other reaction to the first post to show your support.
- If one exists and is closed, check the reason for closing:
- If marked
wontfix
, the feature request has been rejected. Please do not create a new request. If you feel there is a strong reason to reconsider and the thread is not locked, add your thoughts to the existing issue. - If not marked
wontfix
, the feature may have been implemented already! If that is the case, there will be a pull request linked somewhere in the issue's conversation.
- If marked
If no similar request exists, you can submit a new one, with the following:
- The feature being requested.
- The benefit this feature will bring to users.
- Why this feature should be implemented in
hoard
and not externally.
If these are not included in the initial request, they will probably be asked for before the request will be considered.
This section describes guidelines for how to write code that will be accepted.
Any code that is submitted via Pull Request needs to pass clippy
checks and be formatted using cargo fmt
. There are
CI checks in place that will fail if this is not the case.
Any new code should be logged appropriately:
ERROR
: Fatal errors must be logged where they are created. If the error is built recursively or in a loop, this only applies to the final recursion/iteration.WARN
: Non-fatal errors and potentially unexpected behavior (e.g. an operation being skipped) must be logged the same as fatal ones, but with this log level.INFO
: Messages to inform the user of the high-level progress of the application get logged here. "High-level" currently means no more frequent than once perHoard
.DEBUG
: More detailed messages to inform the user of some of the lower-level workings of the program. This generally means anything more specific thanINFO
but less specific thanTRACE
. A good rule of thumb is that multiple instances of a singleDEBUG
message should not take up more than one full-screen console window.TRACE
: Very detailed messages that announce every non-trivial operation in the program.
These are some general rules used for writing log statements.
- Logged messages must start with lowercase letters and remain lowercase unless there is a specific reason to have capital letters.
- If a
hoard
library function may call anotherhoard
library function and/or contains a loop, create a new span before that point with the necesssary context. - A span's context should only contain anything used in the immediate context. Items passed through to other library functions should be part of that more specific context, instead.
- Let
hoard
library functions log themselves being called; create spans before calling for context, if necessary. That is, if there is a function call todo_a_thing()
, the log message"Doing a thing"
should come from insidedo_a_thing()
. - If there must be an event logged with the creation of a span, log the event first so that the context logged with it remains minimal.
Ignored lines should be limited to the following:
- Logging statements
- "This should never happen" panics/asserts in testing code.
- Code containing
unimplemented!()
(i.e. should never be called) - Lines containing only opening/closing braces that are marked as missing coverage
- Manual error propagation
- That is, something like inspecting a lower error to return a specific higher one, or otherwise returning the original error.
Lines can be manually ignored by adding a comment with grcov: ignore
on that line.