carvel-dev / carvel-dev/ytt

improve error message when ) is missing on prev line

Open
#211 1 comment 0 reactions 0 assignees View on GitHub
enhancement error msg improvement
Dominant language
Go
Stars
1.9k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

when closing ) is missing on a prev line error message `got identifier, want ','` pops up. since ytt shows error related line it's a bit confusing that ) is missing on the prev line.

- https://get-ytt.io/#gist:https://gist.github.com/cppforlife/c34961a5e9a5aa31a16d6d678ed28f96
- https://get-ytt.io/#gist:https://gist.github.com/cppforlife/8c7088cab2b7b64752fbc4481cac5a17

should we add some hint to indicate this similar to this: https://github.com/k14s/ytt/blob/582ad9ca849559e5d75b680b1831105059a0e953/pkg/template/error_hints_test.go

Contributor guide

Open the contributing guide

Research direction

Reproduce the two linked examples to confirm the confusing `got identifier, want ','` error. Start with pkg/template/error_hints_test.go and the existing error-hint cases; done means the missing `)` is indicated clearly when the reported error line is the following line, with tests covering the examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.