Extraneous space inserted after trailing comma
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11
- Forks
- 4
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 1
Description
In many places Zeek allows trailing commas. This seems to be handled inconsistently.
For enums I see expected behavior:
type E: enum { a, b, c, };
For set-like constructs I see an additional space:
const s = { 1, 2, 3, };
# ^
const r: RecordType = [ $a=1, $b=2, $c=3, ];
# ^
We probably have the same issue for function-like constructors, e.g.,
const a = vector(1, 2, 3, );
# ^
The issue seems to be that we insert an space after , in the contexts even though it is not followed by more arguments.
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.
Research direction
Start by locating the formatter entry points for enum, set-like, record, and vector constructs, then inspect how trailing commas are rendered. Reproduce the examples from the issue and compare each output with the enum behavior. Done means trailing commas are preserved without an extra space when no following argument exists, with coverage for the listed constructs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100