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

Enhance linter errors for invalid root-level 'if` statements #64

Open
mihaitodor opened this issue Jul 30, 2024 · 0 comments
Open

Enhance linter errors for invalid root-level 'if` statements #64

mihaitodor opened this issue Jul 30, 2024 · 0 comments
Labels
bloblang Bloblang features needs investigation It looks as though have all the information needed but investigation is required

Comments

@mihaitodor
Copy link
Collaborator

Linting the following bloblang mapping:

if true { 
  deleted() 
} else {
  root.foo = 42
} 

produces the following error:

Input
Output
failed to parse mapping: line 4 char 12: required: expected }
  |
4 |   root.foo = 42
  |            ^---

Not sure if it's possible to enhance it without a breaking change though, because I think root = is implicit when there's no else clause (i.e. if true { deleted() })

@mihaitodor mihaitodor added bloblang Bloblang features needs investigation It looks as though have all the information needed but investigation is required labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bloblang Bloblang features needs investigation It looks as though have all the information needed but investigation is required
Projects
None yet
Development

No branches or pull requests

1 participant