Skip to content

Commit

Permalink
chore: remove redundant helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Sep 11, 2018
1 parent bae3c99 commit 5285c24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion graphviz.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func orphansGraph(issues Issues, opts *renderOptions) (string, error) {
continue
}
panicIfErr(issue.AddNodeToGraph(g, fmt.Sprintf("cluster_%s", issue.RepoID())))
repos[issue.RepoID()] = issue.FullRepo()
repos[issue.RepoID()] = issue.Path()
}

for id, repo := range repos {
Expand Down
14 changes: 7 additions & 7 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ func FromGitHubIssue(input *github.Issue) *Issue {
})
}
for _, assignee := range input.Assignees {
name := *assignee.Login
if assignee.Name != nil {
name = *assignee.Name
}
issue.Assignees = append(issue.Assignees, &Profile{
Name: *assignee.Name,
Name: name,
Username: *assignee.Login,
})
}
Expand Down Expand Up @@ -172,12 +176,8 @@ func (i Issue) Repo() string {
return strings.Split(i.URL, "/")[5]
}

func (i Issue) FullRepo() string {
return fmt.Sprintf("%s/%s", i.Owner(), i.Repo())
}

func (i Issue) RepoID() string {
id := i.FullRepo()
id := i.Path()[1:]
id = strings.Replace(id, "/", "", -1)
id = strings.Replace(id, "-", "", -1)
return id
Expand All @@ -196,7 +196,7 @@ func (i Issue) IsReady() bool {
}

func (i Issue) NodeName() string {
return fmt.Sprintf(`%s#%d`, i.FullRepo(), i.Number)
return fmt.Sprintf(`%s#%d`, i.Path()[1:], i.Number)
}

func (i Issue) NodeTitle() string {
Expand Down

0 comments on commit 5285c24

Please sign in to comment.