Add contribution guidelines for Taskfiles.#14
Conversation
| ```yaml | ||
| my-task: | ||
| cmds: | ||
| - "touch '{{.FILE_PATH}}'" |
There was a problem hiding this comment.
I assume we don't mention "strings should be quoted" in the first place because "have automated linting processes", right?
| Taskfile), replace the `:` in the name with `#` as follows: `{{.TASK | replace \":\" \"#\"}}`. | ||
| * This ensures the task name can be used as a filename. | ||
|
|
||
| ## `sources` and `generates` |
There was a problem hiding this comment.
Do we want to mention how (and why) we want to checksum certain tasks instead of this sources + generates pattern?
If we're short of time, we can do that in another PR.
There was a problem hiding this comment.
Good point. Added.
| * `cmds` | ||
| * `ignore_error` | ||
| * `interactive` | ||
| * Logging |
There was a problem hiding this comment.
I feel it might be more intuitive for readers if we place these next to Descriptors.
| @@ -0,0 +1,161 @@ | |||
| # Taskfiles | |||
There was a problem hiding this comment.
Although not Taskfile-specific, do we want to mention in YAML how we place array elements into separate lines where they can't fit into one?
There was a problem hiding this comment.
Good point. I would suggest we do it in another PR when we add YAML guidelines, and then add a link to them from the Taskfile guidelines.
|
|
||
| ## Ordering of list/map entries | ||
|
|
||
| List/map entries should be ordered alphabetically (except for `vars`). Where there are several |
There was a problem hiding this comment.
Do we want to mention the alphabetical order is case insensitive? The leading characters might be in different cases in paths specified in sources and generates for example.
Co-authored-by: Junhao Liao <junhao@junhao.ca>
junhaoliao
left a comment
There was a problem hiding this comment.
The PR title is fine for the squashed commit message.
| 1. Don't use the variable `{{.ROOT_TASKFILE}}` | ||
| * v3.35.1 has a bug that makes it equivalent to `ROOT_DIR` (i.e., the parent directory of the root | ||
| Taskfile, rather than the path to the root Taskfile). |
There was a problem hiding this comment.
this should be removed now given these days our projects use a newer version of go-task which doesn't have this bug
@coderabbitai create an issue to track
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
gh issue create \
--repo y-scope/yscope-docs \
--title 'Remove outdated `{{.ROOT_TASKFILE}}` bug note from Taskfiles contrib guide' \
--body '## Summary
The Taskfiles contribution guide (`docs/dev-guide/contrib-guides-taskfiles.md`) contains a note warning against using `{{.ROOT_TASKFILE}}` due to a bug in go-task v3.35.1 that caused it to behave like `ROOT_DIR`.
Since our projects now use a newer version of go-task in which this bug has been fixed, this note should be removed.
## Action required
- Remove the `{{.ROOT_TASKFILE}}` built-in variable warning note from `docs/dev-guide/contrib-guides-taskfiles.md`.
## References
- PR: https://github.com/y-scope/yscope-docs/pull/14
- Comment: https://github.com/y-scope/yscope-docs/pull/14#discussion_r2983398850
Requested by: `@junhaoliao`' \
--assignee junhaoliao
Length of output: 48
@junhaoliao, I've created issue #57 to track the removal of the outdated {{.ROOT_TASKFILE}} bug note: #57
Description
This PR starts the contribution guidelines section and open-sources our guidelines for Taskfiles.
Validation performed
task serve