Skip to content

Commit 31ca303

Browse files
authored
Merge pull request #615 from per1234/document-task-params
Document task environment variable parameters
2 parents 4f2b70c + 34febc1 commit 31ca303

File tree

8 files changed

+75
-38
lines changed

8 files changed

+75
-38
lines changed

Taskfile.yml

Lines changed: 28 additions & 17 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
@@ -1013,7 +1018,9 @@ tasks:
10131018
fi
10141019
- shfmt -w "{{.SCRIPT_PATH}}"
10151020

1016-
# Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout
1021+
# Make a temporary file and print the path passed to stdout.
1022+
# Environment variable parameters:
1023+
# - TEMPLATE: template for the format of the filename.
10171024
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
10181025
utility:mktemp-file:
10191026
vars:
@@ -1034,7 +1041,9 @@ tasks:
10341041
vars:
10351042
RAW_PATH: "{{.RAW_PATH}}"
10361043

1037-
# Print a normalized version of the path passed via the RAW_PATH variable to stdout
1044+
# Print a normalized version of the path to stdout.
1045+
# Environment variable parameters:
1046+
# - RAW_PATH: the path to be normalized.
10381047
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
10391048
utility:normalize-path:
10401049
cmds:
@@ -1047,6 +1056,8 @@ tasks:
10471056
echo "{{.RAW_PATH}}"
10481057
fi
10491058
1059+
# Environment variable parameters:
1060+
# - YAMLLINT_FORMAT: yamllint output format (default: colored).
10501061
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
10511062
yaml:lint:
10521063
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-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/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

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}}"

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

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

44
tasks:
5-
# Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout
5+
# Make a temporary file and print the path passed to stdout.
6+
# Environment variable parameters:
7+
# - TEMPLATE: template for the format of the filename.
68
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
79
utility:mktemp-file:
810
vars:
@@ -13,7 +15,9 @@ tasks:
1315
vars:
1416
RAW_PATH: "{{.RAW_PATH}}"
1517

16-
# Print a normalized version of the path passed via the RAW_PATH variable to stdout
18+
# Print a normalized version of the path to stdout.
19+
# Environment variable parameters:
20+
# - RAW_PATH: the path to be normalized.
1721
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
1822
utility:normalize-path:
1923
cmds:

0 commit comments

Comments
 (0)