Skip to content
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

qbec fmt panics on malformed jsonnet string #284

Open
harsimranmaan opened this issue Apr 22, 2022 · 0 comments
Open

qbec fmt panics on malformed jsonnet string #284

harsimranmaan opened this issue Apr 22, 2022 · 0 comments

Comments

@harsimranmaan
Copy link
Contributor

echo "{a : '^/v1/abc-[\w-.]+/xyz/[\w-.]+$'}" > a.jsonnet
qbec fmt a.jsonnet
qbec fmt  a.jsonnet
panic: Badly formatted string, should have been caught in lexer.

goroutine 1 [running]:
github.com/google/go-jsonnet/internal/formatter.(*EnforceStringStyle).LiteralString(0xc0001d38f0, {0x265b158, 0xc0001d38f0}, 0xc0001df080, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/google/[email protected]/internal/formatter/enforce_string_style.go:45 +0x17b
github.com/google/go-jsonnet/internal/pass.(*Base).Visit(0xc000138190, {0x265b158, 0xc0001d38f0}, 0xc000138170, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/google/[email protected]/internal/pass/pass.go:433 +0x24c
github.com/google/go-jsonnet/internal/pass.(*Base).ObjectField(0xc0001380f0, {0x265b158, 0xc0001d38f0}, 0xc0001380f0, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/google/[email protected]/internal/pass/pass.go:162 +0xdd

Expected graceful failure. Might need patching jsonnet upstream or panic recovery in formatter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant