Skip to content

Commit db6a442

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 05d8623 commit db6a442

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

Taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,8 @@ tasks:
10521052
echo "{{.RAW_PATH}}"
10531053
fi
10541054
1055+
# Environment variable parameters:
1056+
# - YAMLLINT_FORMAT: yamllint output format (default: colored).
10551057
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
10561058
yaml:lint:
10571059
desc: Check for problems with YAML files

workflow-templates/assets/check-go-task/Taskfile.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,32 @@ version: "3"
44
tasks:
55
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
66
go:fix:
7-
desc: Modernize usages of outdated APIs
7+
desc: |
8+
Modernize usages of outdated APIs.
9+
Environment variable parameters:
10+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
11+
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
812
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
913
cmds:
1014
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
1115

1216
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
1317
go:format:
14-
desc: Format Go code
18+
desc: |
19+
Format Go code.
20+
Environment variable parameters:
21+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
22+
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
1523
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
1624
cmds:
1725
- go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
1826

1927
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
2028
go:lint:
21-
desc: Lint Go code
29+
desc: |
30+
Lint Go code
31+
Environment variable parameters:
32+
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
2233
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
2334
cmds:
2435
- |

workflow-templates/assets/check-toc-task/Taskfile.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ version: "3"
44
tasks:
55
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-toc-task/Taskfile.yml
66
markdown:toc:
7-
desc: Update the table of contents
7+
desc: |
8+
Update the table of contents.
9+
Environment variable parameters:
10+
- MAX_DEPTH: maximum heading depth for inclusion in ToC.
11+
- FILE_PATH: path to the file that contains the ToC.
812
deps:
913
- task: npm:install-deps
1014
cmds:

workflow-templates/assets/check-yaml-task/Taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
version: "3"
33

44
tasks:
5+
# Environment variable parameters:
6+
# - YAMLLINT_FORMAT: yamllint output format (default: colored).
57
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
68
yaml:lint:
79
desc: Check for problems with YAML files

0 commit comments

Comments
 (0)