You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+25-9Lines changed: 25 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,14 +39,14 @@ The `providers.github` key configures how **source{d} Lookout** will connect wit
39
39
```yaml
40
40
providers:
41
41
github:
42
-
comment_footer: "_If you have feedback about this comment, please, [tell us](%s)._"
42
+
comment_footer: "_Comment made by analyzer '{{.Name}}', [report]({{.Feedback}})._"
43
43
# app_id: 1234
44
44
# private_key: ./key.pem
45
45
# installation_sync_interval: 1h
46
46
# watch_min_interval: 2s
47
47
```
48
48
49
-
`comment_footer` key defines a format-string that will be used for custom messages for every message posted on GitHub; see how to [add a custom message to the posted comments](#add-a-custom-message-to-the-posted-comments)
49
+
`comment_footer` key defines the [go template](https://golang.org/pkg/text/template) that will be used for custom messages for every message posted on GitHub; see how to [add a custom message to the posted comments](#add-a-custom-message-to-the-posted-comments)
50
50
51
51
### Authentication with GitHub
52
52
@@ -141,17 +141,33 @@ analyzers:
141
141
142
142
### Add a Custom Message to the Posted Comments
143
143
144
-
You can configure **source{d} Lookout** to add a custom message to every comment that each analyzer returns. This custom message will be created following the rule:
If any of those two keys are not defined, the custom message won't be added.
144
+
You can configure **source{d} Lookout** to add a custom message to every comment that each analyzer returns. This custom message will be created passing to the template defined by `providers.github.comment_footer`, the `name` and `feedback` defined for each analyzer configuration.
145
+
146
+
If the template (`providers.github.comment_footer`) is empty, or the analyzer configuration does not define any of the values that the template requires, the custom message won't be added.
149
147
150
148
Example:
151
-
```text
152
-
"_If you have feedback about this comment, please, [tell us](%s)._"
149
+
```yaml
150
+
providers:
151
+
github:
152
+
comment_footer: "Comment made by analyzer {{.Name}}, [report]({{.Feedback}})."
153
153
```
154
154
155
+
Will require that each analyzer defines its `name` and `feedback` in order to render its custom message appended to its comments, so:
156
+
157
+
```yaml
158
+
analyzers:
159
+
- name: Fancy Analyzer
160
+
addr: ipv4://localhost:9930
161
+
feedback: http://example.com/report-issue
162
+
- name: Awesome Analyzer
163
+
addr: ipv4://localhost:9931
164
+
```
165
+
166
+
Comments from `Fancy Analyzer` will be appended with the message:
167
+
>_Comment made by analyzer Fancy Analyzer, [report](http://example.com/report-issue)._
168
+
169
+
but comments from `Awesome Analyzer` wont be appended with a custom message because its configuration lacks of a key defining its `feedback` value.
0 commit comments