Skip to content

diffguard-core: render_gitlab_quality_json/render_sarif_json missing # Errors section #604

@EffortlessSteven

Description

@EffortlessSteven

Three public Result-returning functions are missing # Errors sections in their doc comments, triggering clippy's missing_panics_doc / doc documentation lints:

Function File Line
render_gitlab_quality_json gitlab_quality.rs 86
render_sarif_json sarif.rs 230
render_sensor_json sensor.rs 134

Problem: Per Rust API Guidelines C409, public functions returning Result should document their error conditions in an # Errors section. Without this, callers have no guaranteed understanding of when and how these functions can fail.

Fix: Add an # Errors section to each doc comment documenting the serde_json::Error failure condition. For example:

/// # Errors
///
/// Returns an error if JSON serialization fails.
pub fn render_gitlab_quality_json(receipt: &CheckReceipt) -> Result<String, serde_json::Error> {

Priority: Low — these are stable APIs whose error cases are unlikely to change, but the missing docs are a correctness gap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions