Julia supports keyword-argument syntax sugar where a bare identifier (or dot expression) after ; implies the keyword name:
When a bare identifier or dot expression occurs after a semicolon, the keyword argument name is implied by the identifier or field name. For example plot(x, y; width) is equivalent to plot(x, y; width=width) and plot(x, y; options.width) is equivalent to plot(x, y; width=options.width).
(quoted from the Julia manual: https://docs.julialang.org/en/v1/manual/functions/#Keyword-Arguments)
Both styles (plot(x, y; width) and plot(x, y; width=width)) can appear in my codebases, and I would like to unify them automatically via a formatter rule.
Request
Add an option/rule to normalize this syntax:
- Prefer the sugar form:
f(; x=x) → f(; x)
- Or prefer the explicit form:
f(; x) → f(; x=x)
I apologize if I have overlooked existing options or prior discussions.
Julia supports keyword-argument syntax sugar where a bare identifier (or dot expression) after
;implies the keyword name:(quoted from the Julia manual: https://docs.julialang.org/en/v1/manual/functions/#Keyword-Arguments)
Both styles (
plot(x, y; width)andplot(x, y; width=width)) can appear in my codebases, and I would like to unify them automatically via a formatter rule.Request
Add an option/rule to normalize this syntax:
f(; x=x)→f(; x)f(; x)→f(; x=x)I apologize if I have overlooked existing options or prior discussions.