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

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 21, 2025

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.

Related

per1234 added 3 commits June 20, 2025 19:31
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.
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.
Some tasks accept input via environment variables. These parameter variables are documented in the task description.

A standard format has been established for that documentation. Previously, these descriptions did not follow the
standardized format.

Typically, the documentation is done in the task description, to make the information easily accessible to contributors
via the `task list` output. However, a description was intentionally omitted for these tasks. The reason is these tasks
are for internal use by other tasks, only serving to avoid code duplication. So the tasks should not be listed in the
`task list` output. Task actually has a feature for marking such tasks as internal, but unfortunately that only works
for the standard way of calling a task from another task, which can not be used in this case where the output of the
task must be captured. For this reason, the task documentation is intentionally done via a comment instead of the
description as would be done for a contributor facing task.
@per1234 per1234 self-assigned this Jun 21, 2025
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 21, 2025
@per1234 per1234 merged commit 31ca303 into arduino:main Jun 21, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant