Skip to content

Commit a2d4d14

Browse files
committed
Document task environment variable parameters
Some tasks accept input via environment variables. It is important to document these parameter variables. Previously, the parameter environment variables of these tasks were undocumented. Typically, the documentation is done in the task description, to make the information easily accessible to contributors via the `task list` output. However, this approach was intentionally eschewed in the case of the `yaml:lint` task, where the documentation was instead placed in a comment. The reason is that this task's parameter variable is only useful when the task is executed by a GitHub Actions workflow, as is done already in the "Check YAML" workflow. So the contributor running the task from the command line has no need for this information and thus including it in the description would only clutter up the `task list` output with content useless to the reader of that output.
1 parent d2e950d commit a2d4d14

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

Taskfile.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,33 @@ tasks:
157157

158158
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
159159
go:fix:
160-
desc: Modernize usages of outdated APIs
160+
desc: |
161+
Modernize usages of outdated APIs.
162+
Environment variable parameters:
163+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
164+
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
161165
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
162166
cmds:
163167
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
164168

165169
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
166170
go:format:
167-
desc: Format Go code
171+
desc: |
172+
Format Go code.
173+
Environment variable parameters:
174+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
175+
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
168176
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
169177
cmds:
170178
- go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
171179

172180
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
173181
go:lint:
174-
desc: Lint Go code
182+
desc: |
183+
Lint Go code.
184+
Environment variable parameters:
185+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
186+
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
175187
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
176188
cmds:
177189
- |
@@ -186,7 +198,11 @@ tasks:
186198
187199
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
188200
go:vet:
189-
desc: Check for errors in Go code
201+
desc: |
202+
Check for errors in Go code.
203+
Environment variable parameters:
204+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
205+
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
190206
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
191207
cmds:
192208
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
@@ -435,6 +451,8 @@ tasks:
435451
echo "{{.RAW_PATH}}"
436452
fi
437453
454+
# Environment variable parameters:
455+
# - YAMLLINT_FORMAT: yamllint output format (default: colored).
438456
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
439457
yaml:lint:
440458
desc: Check for problems with YAML files

0 commit comments

Comments
 (0)