1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

fix: fixing linting for the github module

adding documentation to github module
fixing malformed icon causing display errors
This commit is contained in:
Joel Valentine
2019-09-06 02:42:06 +01:00
parent e8881ef715
commit 596bfbac02
4 changed files with 29 additions and 10 deletions

View File

@@ -61,7 +61,7 @@ func (widget *Widget) displayMyPullRequests(repo *GithubRepo, username string) s
str := ""
for idx, pr := range prs {
str += fmt.Sprintf(` %s[green]["%d"]%4d[""][white] %s`, widget.mergeString(pr), maxItems + idx, *pr.Number, *pr.Title)
str += fmt.Sprintf(` %s[green]["%d"]%4d[""][white] %s`, widget.mergeString(pr), maxItems+idx, *pr.Number, *pr.Title)
str += "\n"
widget.Items = append(widget.Items, *pr.Number)
}
@@ -73,22 +73,22 @@ func (widget *Widget) displayMyPullRequests(repo *GithubRepo, username string) s
func (widget *Widget) displayCustomQuery(repo *GithubRepo, filter string, perPage int) string {
res := repo.customIssueQuery(filter, perPage)
if res == nil {
return " [grey]Invalid Query[white]\n"
}
issuesLength := len(res.Issues)
if issuesLength == 0 {
return " [grey]none[white]\n"
}
maxItems := widget.GetItemCount()
str := ""
for idx, issue := range res.Issues {
str += fmt.Sprintf(` [green]["%d"]%4d[""][white] %s`, maxItems + idx , *issue.Number, *issue.Title)
str += fmt.Sprintf(` [green]["%d"]%4d[""][white] %s`, maxItems+idx, *issue.Number, *issue.Title)
str += "\n"
widget.Items = append(widget.Items, *issue.Number)
}
@@ -132,9 +132,9 @@ func (widget *Widget) title(repo *GithubRepo) string {
var mergeIcons = map[string]string{
"dirty": "[red]![white] ",
"clean": "[green][white] ",
"unstable": "[red][white] ",
"blocked": "[red][white] ",
"clean": "[green]\u2713[white] ",
"unstable": "[red]\u274C[white] ",
"blocked": "[red]\u274C[white] ",
}
func (widget *Widget) mergeString(pr *github.PullRequest) string {