Skip to content

Commit 05d8623

Browse files
committed
Document parameter environment variables in task descriptions
Tasks are provided to perform common project development and maintenance operations. Some of these tasks are configured by setting an environment variable from the invocation. It will be important for the contributor to be aware of these variables when using the task directly (as opposed to via the "umbrella" convenience functions which set the variables as appropriate for the project). Previously, when done at all, the variables where documented in comments in the taskfile. The contributor would only see that information if they looked at the source content of the taskfile, but a contributor would only be expected to do that if they were working on the taskfile source. The documented way for a contributor to learn about the available tasks is by running the `task --list` command. This displays the contents of the task's `desc` field. So the parameter variables must be documented in that field.
1 parent ae97bc3 commit 05d8623

File tree

4 files changed

+40
-30
lines changed

4 files changed

+40
-30
lines changed

Taskfile.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,12 @@ tasks:
730730
-s "{{.SCHEMA_PATH}}" \
731731
-d "{{.DATA_PATH}}"
732732
733-
# Parameter variables:
734-
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
735733
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
736734
npm:install-deps:
737-
desc: Install dependencies managed by npm
735+
desc: |
736+
Install dependencies managed by npm.
737+
Environment variable parameters:
738+
- PROJECT_PATH: Path of the npm-managed project (default: "./").
738739
run: when_changed
739740
dir: |
740741
"{{default "./" .PROJECT_PATH}}"
@@ -756,11 +757,12 @@ tasks:
756757
--location project \
757758
fix
758759
759-
# Parameter variables:
760-
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
761760
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
762761
npm:validate:
763-
desc: Validate npm configuration files against their JSON schema
762+
desc: |
763+
Validate npm configuration files against their JSON schema.
764+
Environment variable parameters:
765+
- PROJECT_PATH: Path of the npm-managed project (default: "./").
764766
deps:
765767
- task: npm:install-deps
766768
vars:
@@ -956,11 +958,12 @@ tasks:
956958
cmds:
957959
- poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/siteversion/tests
958960

959-
# Parameter variables:
960-
# - SCRIPT_PATH: path of the script to be checked.
961961
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
962962
shell:check:
963-
desc: Check for problems with shell scripts
963+
desc: |
964+
Check for problems with shell scripts.
965+
Environment variable parameters:
966+
- SCRIPT_PATH: path of the script to be checked.
964967
cmds:
965968
- |
966969
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
@@ -979,11 +982,12 @@ tasks:
979982
--format={{default "tty" .SHELLCHECK_FORMAT}} \
980983
"{{.SCRIPT_PATH}}"
981984
982-
# Parameter variables:
983-
# - SCRIPT_PATH: path of the script to be checked.
984985
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
985986
shell:check-mode:
986-
desc: Check for non-executable shell scripts
987+
desc: |
988+
Check for non-executable shell scripts.
989+
Environment variable parameters:
990+
- SCRIPT_PATH: path of the script to be checked.
987991
cmds:
988992
- |
989993
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
@@ -994,11 +998,12 @@ tasks:
994998
- |
995999
test -x "{{.SCRIPT_PATH}}"
9961000
997-
# Parameter variables:
998-
# - SCRIPT_PATH: path of the script to be formatted.
9991001
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
10001002
shell:format:
1001-
desc: Format shell script files
1003+
desc: |
1004+
Format shell script files.
1005+
Environment variable parameters:
1006+
- SCRIPT_PATH: path of the script to be formatted.
10021007
cmds:
10031008
- |
10041009
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ tasks:
1717
--location project \
1818
fix
1919
20-
# Parameter variables:
21-
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
2220
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
2321
npm:validate:
24-
desc: Validate npm configuration files against their JSON schema
22+
desc: |
23+
Validate npm configuration files against their JSON schema.
24+
Environment variable parameters:
25+
- PROJECT_PATH: Path of the npm-managed project (default: "./").
2526
deps:
2627
- task: npm:install-deps
2728
vars:

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
version: "3"
33

44
tasks:
5-
# Parameter variables:
6-
# - SCRIPT_PATH: path of the script to be checked.
75
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
86
shell:check:
9-
desc: Check for problems with shell scripts
7+
desc: |
8+
Check for problems with shell scripts.
9+
Environment variable parameters:
10+
- SCRIPT_PATH: path of the script to be checked.
1011
cmds:
1112
- |
1213
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
@@ -25,11 +26,12 @@ tasks:
2526
--format={{default "tty" .SHELLCHECK_FORMAT}} \
2627
"{{.SCRIPT_PATH}}"
2728
28-
# Parameter variables:
29-
# - SCRIPT_PATH: path of the script to be checked.
3029
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
3130
shell:check-mode:
32-
desc: Check for non-executable shell scripts
31+
desc: |
32+
Check for non-executable shell scripts.
33+
Environment variable parameters:
34+
- SCRIPT_PATH: path of the script to be checked.
3335
cmds:
3436
- |
3537
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
@@ -40,11 +42,12 @@ tasks:
4042
- |
4143
test -x "{{.SCRIPT_PATH}}"
4244
43-
# Parameter variables:
44-
# - SCRIPT_PATH: path of the script to be formatted.
4545
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
4646
shell:format:
47-
desc: Format shell script files
47+
desc: |
48+
Format shell script files.
49+
Environment variable parameters:
50+
- SCRIPT_PATH: path of the script to be formatted.
4851
cmds:
4952
- |
5053
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then

workflow-templates/assets/npm-task/Taskfile.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
version: "3"
33

44
tasks:
5-
# Parameter variables:
6-
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
75
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
86
npm:install-deps:
9-
desc: Install dependencies managed by npm
7+
desc: |
8+
Install dependencies managed by npm.
9+
Environment variable parameters:
10+
- PROJECT_PATH: Path of the npm-managed project (default: "./").
1011
run: when_changed
1112
dir: |
1213
"{{default "./" .PROJECT_PATH}}"

0 commit comments

Comments
 (0)