Summary
Task-go fails to parse a Taskfile.yml when the echo command contains certain special characters like colons (:) or hash symbols (#) in the string, throwing parsing errors.
Steps to Reproduce
Case 1: Colon in echo string
- Create a
Taskfile.yml with the following content:
version: '3'
tasks:
default:
desc: Affiche Hello World
silent: true
cmds:
- echo "Say: Hello World"
- Run
task command. Notice the problematic ":" - Replace "Say:" by "Say"
Case 2: Hash symbol in echo string
- Create a
Taskfile.yml with the following content:
version: '3'
tasks:
default:
desc: Affiche Hello World
silent: true
cmds:
- echo "# Hello World"
- Run
task command
Case 3: Hash symbol with spaces in echo string
- Create a
Taskfile.yml with the following content:
version: '3'
tasks:
default:
desc: Affiche Hello World
silent: true
cmds:
- echo " # Hello World"
- Run
task command
Expected Behavior
The task should execute successfully and output the respective strings:
- Case 1: "Say: Hello World"
- Case 2: "# Hello World"
- Case 3: " # Hello World"
Actual Behavior
Case 1: Colon in echo string
err: invalid keys in command
file: /home/k6r2j9/work/hacks/infra/benchmark/debug/Taskfile.yml:8:9
6 | silent: true
7 | cmds:
> 8 | - echo "Say: Hello World"
| ^
Case 2: Hash symbol in echo string
task: Failed to run task "default": 1:6: reached EOF without closing quote "
Case 3: Hash symbol with spaces in echo string
task: Failed to run task "default": 1:6: reached EOF without closing quote "
Additional Information
- The issue appears to be related to YAML parsing where special characters are being incorrectly interpreted
- Colons (
:) cause "invalid keys in command" errors, suggesting YAML parsing issues
- Hash symbols (
#) cause "reached EOF without closing quote" errors, suggesting quote parsing issues
- This affects any echo command containing these special characters in the string
- The error messages suggest both YAML parsing and quote parsing problems
Impact
This bug prevents users from using common special characters like colons (:) and hash symbols (#) in echo statements within Taskfile.yml.
Version
3.44.1
Operating system
Linux 6.8.0-60-generic
Experiments Enabled
No response
Example Taskfile
Summary
Task-go fails to parse a Taskfile.yml when the echo command contains certain special characters like colons (
:) or hash symbols (#) in the string, throwing parsing errors.Steps to Reproduce
Case 1: Colon in echo string
Taskfile.ymlwith the following content:taskcommand. Notice the problematic ":" - Replace "Say:" by "Say"Case 2: Hash symbol in echo string
Taskfile.ymlwith the following content:taskcommandCase 3: Hash symbol with spaces in echo string
Taskfile.ymlwith the following content:taskcommandExpected Behavior
The task should execute successfully and output the respective strings:
Actual Behavior
Case 1: Colon in echo string
Case 2: Hash symbol in echo string
Case 3: Hash symbol with spaces in echo string
Additional Information
:) cause "invalid keys in command" errors, suggesting YAML parsing issues#) cause "reached EOF without closing quote" errors, suggesting quote parsing issuesImpact
This bug prevents users from using common special characters like colons (
:) and hash symbols (#) in echo statements within Taskfile.yml.Version
3.44.1
Operating system
Linux 6.8.0-60-generic
Experiments Enabled
No response
Example Taskfile