Skip to content

Commit 1ee706d

Browse files
committed
docs: make README examples more readable
1 parent f20266f commit 1ee706d

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

README.md

+22-8
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,17 @@ label:
187187
color: "$pink"
188188
# From this script, returning a list of labels
189189
script: >
190-
merge_request.modified_files_list("pkg/service/") // Generate a list of all file paths that was changed in the Merge Request inside pkg/service/
191-
| map({ filepath_dir(#) }) // Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
192-
| map({ trimPrefix(#, "pkg/") }) // Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
193-
| uniq() // Remove duplicate values from the output
190+
// Generate a list of all file paths that was changed in the Merge Request inside pkg/service/
191+
merge_request.modified_files_list("pkg/service/")
192+
193+
// Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
194+
| map({ filepath_dir(#) })
195+
196+
// Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
197+
| map({ trimPrefix(#, "pkg/") })
198+
199+
// Remove duplicate values from the output
200+
| uniq()
194201
```
195202

196203
### `label` (list)
@@ -300,10 +307,17 @@ label:
300307
description: "Modified this service directory"
301308
color: "$pink"
302309
script: >
303-
merge_request.modified_files_list("pkg/service/") // Generate a list of all file paths that was changed in the Merge Request inside pkg/service/
304-
| map({ filepath_dir(#) }) // Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
305-
| map({ trimPrefix(#, "pkg/") }) // Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
306-
| uniq() // Remove duplicate values from the output
310+
// Generate a list of all file paths that was changed in the Merge Request inside pkg/service/
311+
merge_request.modified_files_list("pkg/service/")
312+
313+
// Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
314+
| map({ filepath_dir(#) })
315+
316+
// Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
317+
| map({ trimPrefix(#, "pkg/") })
318+
319+
// Remove duplicate values from the output
320+
| uniq()
307321
```
308322

309323
#### `label.color` (required)

0 commit comments

Comments
 (0)