Skip to content

Document task environment variable parameters #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,12 @@ tasks:
-s "{{.SCHEMA_PATH}}" \
-d "{{.DATA_PATH}}"

# Parameter variables:
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
npm:install-deps:
desc: Install dependencies managed by npm
desc: |
Install dependencies managed by npm.
Environment variable parameters:
- PROJECT_PATH: Path of the npm-managed project (default: "./").
run: when_changed
dir: |
"{{default "./" .PROJECT_PATH}}"
Expand All @@ -756,11 +757,12 @@ tasks:
--location project \
fix

# Parameter variables:
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
npm:validate:
desc: Validate npm configuration files against their JSON schema
desc: |
Validate npm configuration files against their JSON schema.
Environment variable parameters:
- PROJECT_PATH: Path of the npm-managed project (default: "./").
deps:
- task: npm:install-deps
vars:
Expand Down Expand Up @@ -956,11 +958,12 @@ tasks:
cmds:
- poetry run pytest workflow-templates/assets/deploy-mkdocs-versioned/siteversion/tests

# Parameter variables:
# - SCRIPT_PATH: path of the script to be checked.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
shell:check:
desc: Check for problems with shell scripts
desc: |
Check for problems with shell scripts.
Environment variable parameters:
- SCRIPT_PATH: path of the script to be checked.
cmds:
- |
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
Expand All @@ -979,11 +982,12 @@ tasks:
--format={{default "tty" .SHELLCHECK_FORMAT}} \
"{{.SCRIPT_PATH}}"

# Parameter variables:
# - SCRIPT_PATH: path of the script to be checked.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
shell:check-mode:
desc: Check for non-executable shell scripts
desc: |
Check for non-executable shell scripts.
Environment variable parameters:
- SCRIPT_PATH: path of the script to be checked.
cmds:
- |
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
Expand All @@ -994,11 +998,12 @@ tasks:
- |
test -x "{{.SCRIPT_PATH}}"

# Parameter variables:
# - SCRIPT_PATH: path of the script to be formatted.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
shell:format:
desc: Format shell script files
desc: |
Format shell script files.
Environment variable parameters:
- SCRIPT_PATH: path of the script to be formatted.
cmds:
- |
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
Expand All @@ -1013,7 +1018,9 @@ tasks:
fi
- shfmt -w "{{.SCRIPT_PATH}}"

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

# Print a normalized version of the path passed via the RAW_PATH variable to stdout
# Print a normalized version of the path to stdout.
# Environment variable parameters:
# - RAW_PATH: the path to be normalized.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
utility:normalize-path:
cmds:
Expand All @@ -1047,6 +1056,8 @@ tasks:
echo "{{.RAW_PATH}}"
fi

# Environment variable parameters:
# - YAMLLINT_FORMAT: yamllint output format (default: colored).
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
yaml:lint:
desc: Check for problems with YAML files
Expand Down
17 changes: 14 additions & 3 deletions workflow-templates/assets/check-go-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ version: "3"
tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
go:fix:
desc: Modernize usages of outdated APIs
desc: |
Modernize usages of outdated APIs.
Environment variable parameters:
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
- GO_PACKAGES: List of Go packages to modernize (default: all packages of the module).
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
cmds:
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}

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

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
go:lint:
desc: Lint Go code
desc: |
Lint Go code
Environment variable parameters:
- GO_MODULE_PATH: Path of the Go module root (default: {{.DEFAULT_GO_MODULE_PATH}}).
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
cmds:
- |
Expand Down
7 changes: 4 additions & 3 deletions workflow-templates/assets/check-npm-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ tasks:
--location project \
fix

# Parameter variables:
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml
npm:validate:
desc: Validate npm configuration files against their JSON schema
desc: |
Validate npm configuration files against their JSON schema.
Environment variable parameters:
- PROJECT_PATH: Path of the npm-managed project (default: "./").
deps:
- task: npm:install-deps
vars:
Expand Down
21 changes: 12 additions & 9 deletions workflow-templates/assets/check-shell-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
version: "3"

tasks:
# Parameter variables:
# - SCRIPT_PATH: path of the script to be checked.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
shell:check:
desc: Check for problems with shell scripts
desc: |
Check for problems with shell scripts.
Environment variable parameters:
- SCRIPT_PATH: path of the script to be checked.
cmds:
- |
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
Expand All @@ -25,11 +26,12 @@ tasks:
--format={{default "tty" .SHELLCHECK_FORMAT}} \
"{{.SCRIPT_PATH}}"

# Parameter variables:
# - SCRIPT_PATH: path of the script to be checked.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
shell:check-mode:
desc: Check for non-executable shell scripts
desc: |
Check for non-executable shell scripts.
Environment variable parameters:
- SCRIPT_PATH: path of the script to be checked.
cmds:
- |
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
Expand All @@ -40,11 +42,12 @@ tasks:
- |
test -x "{{.SCRIPT_PATH}}"

# Parameter variables:
# - SCRIPT_PATH: path of the script to be formatted.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
shell:format:
desc: Format shell script files
desc: |
Format shell script files.
Environment variable parameters:
- SCRIPT_PATH: path of the script to be formatted.
cmds:
- |
if [[ "{{.SCRIPT_PATH}}" == "" ]]; then
Expand Down
6 changes: 5 additions & 1 deletion workflow-templates/assets/check-toc-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ version: "3"
tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-toc-task/Taskfile.yml
markdown:toc:
desc: Update the table of contents
desc: |
Update the table of contents.
Environment variable parameters:
- MAX_DEPTH: maximum heading depth for inclusion in ToC.
- FILE_PATH: path to the file that contains the ToC.
deps:
- task: npm:install-deps
cmds:
Expand Down
2 changes: 2 additions & 0 deletions workflow-templates/assets/check-yaml-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
version: "3"

tasks:
# Environment variable parameters:
# - YAMLLINT_FORMAT: yamllint output format (default: colored).
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
yaml:lint:
desc: Check for problems with YAML files
Expand Down
7 changes: 4 additions & 3 deletions workflow-templates/assets/npm-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
version: "3"

tasks:
# Parameter variables:
# - PROJECT_PATH: path of the npm-managed project. Default value: "./"
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
npm:install-deps:
desc: Install dependencies managed by npm
desc: |
Install dependencies managed by npm.
Environment variable parameters:
- PROJECT_PATH: Path of the npm-managed project (default: "./").
run: when_changed
dir: |
"{{default "./" .PROJECT_PATH}}"
Expand Down
8 changes: 6 additions & 2 deletions workflow-templates/assets/windows-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
version: "3"

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

# Print a normalized version of the path passed via the RAW_PATH variable to stdout
# Print a normalized version of the path to stdout.
# Environment variable parameters:
# - RAW_PATH: the path to be normalized.
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
utility:normalize-path:
cmds:
Expand Down
Loading