redpanda-data / redpanda-data/benthos
Enhance linter errors for invalid root-level 'if` statements
Open
Nobody has claimed this yet.
bloblang
needs investigation
- Dominant language
- Go
- Stars
- 571
- Forks
- 120
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 18
Description
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() })
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided Bloblang mapping and trace the parser or linter path that reports the error at line 4. The work is done when invalid root-level if statements receive a more useful diagnostic while preserving the stated implicit root assignment behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100