bug: CLI readAll stops reading at first empty line instead of reading to EOF
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- cli
Research direction
Start with the readAll helpers in cli/LckJsonFmt.lean and cli/LckJsonTree.lean, then inspect how each CLI reads stdin. Verify the behavior with input containing a blank line and confirm that reading continues through blank lines and ends only at EOF without truncating the JSON.
Written by the indexing model from the issue text.
Description
Problem
Both cli/LckJsonFmt.lean and cli/LckJsonTree.lean define a readAll helper that reads stdin line-by-line, stopping as soon as it reads an empty line:
repeat
let line ← stdin.getLine
if line.isEmpty then break -- WRONG: also breaks on blank lines mid-input
buf := buf ++ line
This means any JSON that contains a blank line (e.g., pretty-printed JSON piped from another tool, or JSON with embedded newlines before/after values) will be silently truncated.
Expected fix
Read until EOF. IO.Stream.getLine returns "" on EOF — use IO.Stream.isEof or check for EOF after each read instead of treating an empty line as the terminator. Example:
repeat
let line ← stdin.getLine
if (← stdin.isEof) then break
buf := buf ++ line
References
- Flagged by AI code review on PR #8
- Dominant language
- Lean
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from lambdaclass/lambda_compiler_kit
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
All issues in lambdaclass/lambda_compiler_kit
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
from:qa priority:P2 reliability tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spec-kitty/spec-kitty#4874 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
automation code-quality cookie deep-report documentation improvement quick-win task-mining
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100