Skip to content

Commit dc8b3fb

Browse files
committed
Reduce visual noise in report
1 parent 9a9d986 commit dc8b3fb

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ jobs:
9494
9595
It will post a comment on PRs to notify subscribers:
9696
97-
> # CODENOTIFY report
98-
>
99-
> a1b2c3...d4e5f6
97+
> Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff a1b2c3...d4e5f6.
10098
>
10199
> | Notify | File(s) |
102100
> | ------ | -------------------- |

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ type options struct {
351351
print func(notifs map[string][]string) error
352352
}
353353

354-
const markdownCommentTitle = "# CODENOTIFY report\n\n"
354+
const markdownCommentTitle = "<!-- codenotify report -->\n"
355355

356356
func (o *options) writeNotifications(w io.Writer, notifs map[string][]string) error {
357357
subs := []string{}
@@ -374,7 +374,7 @@ func (o *options) writeNotifications(w io.Writer, notifs map[string][]string) er
374374
return nil
375375
case "markdown":
376376
fmt.Fprint(w, markdownCommentTitle)
377-
fmt.Fprintf(w, "%s...%s\n\n", o.baseRef, o.headRef)
377+
fmt.Fprintf(w, "Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff %s...%s.\n\n", o.baseRef, o.headRef)
378378
if len(notifs) == 0 {
379379
fmt.Fprintln(w, "No notifications.")
380380
} else {

main_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ func TestWriteNotifications(t *testing.T) {
145145
},
146146
notifs: nil,
147147
output: []string{
148-
"# CODENOTIFY report",
149-
"",
150-
"a...b",
148+
"<!-- codenotify report -->",
149+
"Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff a...b.",
151150
"",
152151
"No notifications.",
153152
},
@@ -177,9 +176,8 @@ func TestWriteNotifications(t *testing.T) {
177176
"@js": {"file.js", "dir/file.js"},
178177
},
179178
output: []string{
180-
"# CODENOTIFY report",
181-
"",
182-
"a...b",
179+
"<!-- codenotify report -->",
180+
"Notifying subscribers in [CODENOTIFY](https://github.com/sourcegraph/codenotify) files for diff a...b.",
183181
"",
184182
"| Notify | File(s) |",
185183
"|-|-|",

0 commit comments

Comments
 (0)