Skip to content

Commit e85259d

Browse files
committed
Remove labels from the issue preview header
See cli#652 (comment)
1 parent 9a6026e commit e85259d

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

command/issue.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,26 +254,17 @@ func IssueStateTitleWithColor(state string) string {
254254
}
255255

256256
func printIssuePreview(out io.Writer, issue *api.Issue) error {
257-
coloredLabels := labelList(*issue)
258-
if coloredLabels != "" {
259-
coloredLabels = fmt.Sprintf("%s", coloredLabels)
260-
}
261-
262257
now := time.Now()
263258
ago := now.Sub(issue.CreatedAt)
264259

265260
fmt.Fprintln(out, utils.Bold(issue.Title))
266261
fmt.Fprintf(out, "%s", IssueStateTitleWithColor(issue.State))
267-
fmt.Fprint(out, utils.Gray(fmt.Sprintf(
262+
fmt.Fprintln(out, utils.Gray(fmt.Sprintf(
268263
" • %s opened %s • %s",
269264
issue.Author.Login,
270265
utils.FuzzyAgo(ago),
271266
utils.Pluralize(issue.Comments.TotalCount, "comment"),
272267
)))
273-
if coloredLabels != "" {
274-
fmt.Fprintf(out, utils.Gray(fmt.Sprintf(" • %s", coloredLabels)))
275-
}
276-
fmt.Fprintf(out, "\n")
277268

278269
if issue.Body != "" {
279270
fmt.Fprintln(out)

command/issue_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func TestIssueView_preview(t *testing.T) {
297297

298298
expectedLines := []*regexp.Regexp{
299299
regexp.MustCompile(`ix of coins`),
300-
regexp.MustCompile(`Open • marseilles opened about 292 years ago • 9 comments • tarot`),
300+
regexp.MustCompile(`Open • marseilles opened about 292 years ago • 9 comments`),
301301
regexp.MustCompile(`bold story`),
302302
regexp.MustCompile(`View this issue on GitHub: https://github.com/OWNER/REPO/issues/123`),
303303
}
@@ -357,7 +357,7 @@ func TestIssueView_previewClosedState(t *testing.T) {
357357

358358
expectedLines := []*regexp.Regexp{
359359
regexp.MustCompile(`ix of coins`),
360-
regexp.MustCompile(`Closed • marseilles opened about 292 years ago • 9 comments • tarot`),
360+
regexp.MustCompile(`Closed • marseilles opened about 292 years ago • 9 comments`),
361361
regexp.MustCompile(`bold story`),
362362
regexp.MustCompile(`View this issue on GitHub: https://github.com/OWNER/REPO/issues/123`),
363363
}
@@ -387,7 +387,7 @@ func TestIssueView_previewWithEmptyBody(t *testing.T) {
387387

388388
expectedLines := []*regexp.Regexp{
389389
regexp.MustCompile(`ix of coins`),
390-
regexp.MustCompile(`Open • marseilles opened about 292 years ago • 9 comments • tarot`),
390+
regexp.MustCompile(`Open • marseilles opened about 292 years ago • 9 comments`),
391391
regexp.MustCompile(`View this issue on GitHub: https://github.com/OWNER/REPO/issues/123`),
392392
}
393393
for _, r := range expectedLines {

0 commit comments

Comments
 (0)