From dc8b3fb8aa9f82608acce8e1284db480bba4a4a9 Mon Sep 17 00:00:00 2001 From: Nick Snyder Date: Tue, 15 Sep 2020 22:06:21 -0700 Subject: [PATCH] Reduce visual noise in report --- README.md | 4 +--- main.go | 4 ++-- main_test.go | 10 ++++------ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 58d161e..38cb846 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,7 @@ jobs: It will post a comment on PRs to notify subscribers: -> # CODENOTIFY report -> -> a1b2c3...d4e5f6 +> Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff a1b2c3...d4e5f6. > > | Notify | File(s) | > | ------ | -------------------- | diff --git a/main.go b/main.go index 49a1631..abdcb94 100644 --- a/main.go +++ b/main.go @@ -351,7 +351,7 @@ type options struct { print func(notifs map[string][]string) error } -const markdownCommentTitle = "# CODENOTIFY report\n\n" +const markdownCommentTitle = "\n" func (o *options) writeNotifications(w io.Writer, notifs map[string][]string) error { subs := []string{} @@ -374,7 +374,7 @@ func (o *options) writeNotifications(w io.Writer, notifs map[string][]string) er return nil case "markdown": fmt.Fprint(w, markdownCommentTitle) - fmt.Fprintf(w, "%s...%s\n\n", o.baseRef, o.headRef) + fmt.Fprintf(w, "Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff %s...%s.\n\n", o.baseRef, o.headRef) if len(notifs) == 0 { fmt.Fprintln(w, "No notifications.") } else { diff --git a/main_test.go b/main_test.go index 5d22943..912cd28 100644 --- a/main_test.go +++ b/main_test.go @@ -145,9 +145,8 @@ func TestWriteNotifications(t *testing.T) { }, notifs: nil, output: []string{ - "# CODENOTIFY report", - "", - "a...b", + "", + "Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff a...b.", "", "No notifications.", }, @@ -177,9 +176,8 @@ func TestWriteNotifications(t *testing.T) { "@js": {"file.js", "dir/file.js"}, }, output: []string{ - "# CODENOTIFY report", - "", - "a...b", + "", + "Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff a...b.", "", "| Notify | File(s) |", "|-|-|",