-
-
Notifications
You must be signed in to change notification settings - Fork 763
Closed as not planned
Closed as not planned
Copy link
Labels
state: working as intendedThe issue described is working as originally intended.The issue described is working as originally intended.
Description
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.ymlwith the following content:
version: '3'
tasks:
default:
desc: Affiche Hello World
silent: true
cmds:
- echo "Say: Hello World"- Run
taskcommand. Notice the problematic ":" - Replace "Say:" by "Say"
Case 2: Hash symbol in echo string
- Create a
Taskfile.ymlwith the following content:
version: '3'
tasks:
default:
desc: Affiche Hello World
silent: true
cmds:
- echo "# Hello World"- Run
taskcommand
Case 3: Hash symbol with spaces in echo string
- Create a
Taskfile.ymlwith the following content:
version: '3'
tasks:
default:
desc: Affiche Hello World
silent: true
cmds:
- echo " # Hello World"- Run
taskcommand
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
Metadata
Metadata
Assignees
Labels
state: working as intendedThe issue described is working as originally intended.The issue described is working as originally intended.