Skip to content

Add comment explaining empty line handling in diagnostic parser #20

Description

@davidnbr

Description

The empty line handling logic in parseDiagnosticBlock skips empty lines before severity is set but preserves them after. This behavior should be documented with a comment.

Location

main.go:1493-1498

Current Code

if trimmed == "" {
    if severity != "" {
        details = append(details, DiagnosticLine{Content: ""})
    }
    continue
}

Suggestion

Add explanatory comment:

// Skip empty lines before header is found; preserve them after for spacing in output
if trimmed == "" {
    if severity != "" {
        details = append(details, DiagnosticLine{Content: ""})
    }
    continue
}

Created from code review of fix_errors_format_default branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions