Skip to content

Commit

Permalink
fix: fix all stylecheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersiddhu committed May 8, 2021
1 parent 4864819 commit 6b7d13f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions internal/app/comment/ontology.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const tmpl = `
{{- range $y,$v := $rc.Violations}}
- {{$v}}
{{- end}}
{{if $rc.Html}}
{{if $rc.HTML}}
> #### Full report
{{$rc.Html}}
{{$rc.HTML}}
{{- end}}
{{- end}}
{{- end}}
Expand All @@ -40,9 +40,9 @@ const tmpl = `
## :heavy_check_mark: :heavy_check_mark: Ontology pass :heavy_check_mark: :heavy_check_mark:
{{- range $i,$rc := index . "pass"}}
> ### File: *{{$rc.Name}}*
{{if $rc.Html}}
{{if $rc.HTML}}
> #### Full report
{{$rc.Html}}
{{$rc.HTML}}
{{- end}}
{{- end}}
{{- end}}
Expand All @@ -59,7 +59,7 @@ type reportParams struct {

type reportContent struct {
Name string
Html string
HTML string
Violations []string
}

Expand Down Expand Up @@ -89,7 +89,7 @@ func OntoReportOnPullComment(c *cli.Context) error {
func ontoReport(c *cli.Context, cf []string) (map[string][]*reportContent, error) {
rs := make(map[string][]*reportContent)
for _, f := range cf {
html, err := readHtmlContent(
html, err := readHTMLContent(
fmt.Sprintf(
"%s.html",
filepath.Join(c.String("report-dir"), f),
Expand All @@ -111,12 +111,12 @@ func ontoReport(c *cli.Context, cf []string) (map[string][]*reportContent, error
rs["pass"],
&reportContent{
Name: fmt.Sprintf("%s.obo", f),
Html: html,
HTML: html,
},
)
} else {
rs["pass"] = []*reportContent{
{Name: fmt.Sprintf("%s.obo", f), Html: html},
{Name: fmt.Sprintf("%s.obo", f), HTML: html},
}
}
continue
Expand All @@ -126,21 +126,21 @@ func ontoReport(c *cli.Context, cf []string) (map[string][]*reportContent, error
&reportContent{
Name: fmt.Sprintf("%s.obo", f),
Violations: v,
Html: html,
HTML: html,
},
)
continue
}
rs["fail"] = []*reportContent{{
Name: fmt.Sprintf("%s.obo", f),
Violations: v,
Html: html,
HTML: html,
}}
}
return rs, nil
}

func readHtmlContent(file string) (string, error) {
func readHTMLContent(file string) (string, error) {
if _, err := os.Stat(file); os.IsNotExist(err) {
return "", nil
}
Expand Down
8 changes: 4 additions & 4 deletions internal/app/comment/ontology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

const (
fakeHtml = `
fakeHTML = `
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
Expand Down Expand Up @@ -69,7 +69,7 @@ func failData() map[string][]*reportContent {
"no env",
"green is good",
},
Html: fakeHtml,
HTML: fakeHTML,
},
}
return data
Expand All @@ -79,7 +79,7 @@ func passData() map[string][]*reportContent {
data := make(map[string][]*reportContent)
data["pass"] = []*reportContent{
{Name: "dicty_assay.obo"},
{Name: "dicty_flower.obo", Html: fakeHtml},
{Name: "dicty_flower.obo", HTML: fakeHTML},
{Name: "foobar.obo"},
}
return data
Expand All @@ -88,7 +88,7 @@ func passData() map[string][]*reportContent {
func failAndPassData() map[string][]*reportContent {
data := make(map[string][]*reportContent)
data["pass"] = []*reportContent{
{Name: "dicty_assay.obo", Html: fakeHtml},
{Name: "dicty_assay.obo", HTML: fakeHTML},
{Name: "dicty_flower.obo"},
{Name: "foobar.obo"},
}
Expand Down

0 comments on commit 6b7d13f

Please sign in to comment.