fix(lint): remove unused error return from buildCVSummary (#466)

buildCVSummary always returned nil for its error value, causing
golangci-lint to fail with "result 1 (error) is always nil".

The function handles errors internally by returning partial data,
so the error return was misleading. Removed it and updated caller.
This commit is contained in:
Daniel Sauer
2026-01-13 22:16:44 +01:00
committed by GitHub
parent bda248fb9a
commit c0526f244e

View File

@@ -407,11 +407,7 @@ func runPolecatIdentityShow(cmd *cobra.Command, args []string) error {
sessionRunning, _ := polecatMgr.IsRunning(polecatName)
// Build CV summary with enhanced analytics
cv, err := buildCVSummary(r.Path, rigName, polecatName, beadID, clonePath)
if err != nil {
// Continue without CV if there's an error
cv = &CVSummary{Identity: beadID}
}
cv := buildCVSummary(r.Path, rigName, polecatName, beadID, clonePath)
// JSON output - include both identity details and CV
if polecatIdentityShowJSON {
@@ -707,7 +703,8 @@ func runPolecatIdentityRemove(cmd *cobra.Command, args []string) error {
}
// buildCVSummary constructs the CV summary for a polecat.
func buildCVSummary(rigPath, rigName, polecatName, identityBeadID, clonePath string) (*CVSummary, error) {
// Returns a partial CV on errors rather than failing - CV data is best-effort.
func buildCVSummary(rigPath, rigName, polecatName, identityBeadID, clonePath string) *CVSummary {
cv := &CVSummary{
Identity: identityBeadID,
Languages: make(map[string]int),
@@ -787,7 +784,7 @@ func buildCVSummary(rigPath, rigName, polecatName, identityBeadID, clonePath str
cv.FirstPassRate = float64(cv.IssuesCompleted) / float64(total)
}
return cv, nil
return cv
}
// IssueInfo holds basic issue information for CV queries.