Skip to content

Commit

Permalink
fix: reduce total no of lines in ontoReport function
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersiddhu committed May 8, 2021
1 parent 6b7d13f commit 846fc3e
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions internal/app/comment/ontology.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ func ontoReport(c *cli.Context, cf []string) (map[string][]*reportContent, error
rs := make(map[string][]*reportContent)
for _, f := range cf {
html, err := readHTMLContent(
fmt.Sprintf(
"%s.html",
filepath.Join(c.String("report-dir"), f),
),
fmt.Sprintf("%s.html", filepath.Join(c.String("report-dir"), f)),
)
if err != nil {
return rs, err
Expand All @@ -107,28 +104,21 @@ func ontoReport(c *cli.Context, cf []string) (map[string][]*reportContent, error
return rs, err
}
if _, ok := rs["pass"]; ok {
rs["pass"] = append(
rs["pass"],
&reportContent{
Name: fmt.Sprintf("%s.obo", f),
HTML: html,
},
)
rs["pass"] = append(rs["pass"], &reportContent{
Name: fmt.Sprintf("%s.obo", f),
HTML: html,
})
} else {
rs["pass"] = []*reportContent{
{Name: fmt.Sprintf("%s.obo", f), HTML: html},
}
rs["pass"] = []*reportContent{{Name: fmt.Sprintf("%s.obo", f), HTML: html}}
}
continue
}
if _, ok := rs["fail"]; ok {
rs["fail"] = append(rs["fail"],
&reportContent{
Name: fmt.Sprintf("%s.obo", f),
Violations: v,
HTML: html,
},
)
rs["fail"] = append(rs["fail"], &reportContent{
Name: fmt.Sprintf("%s.obo", f),
Violations: v,
HTML: html,
})
continue
}
rs["fail"] = []*reportContent{{
Expand Down

0 comments on commit 846fc3e

Please sign in to comment.