-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
We should run a formatter on the String result of sprint(io, expr).
JuliaFormatting.jl and Runic.jl may be useless for this task, as there they both assume user-written code, but printing an Expr to String will return almost clean Julia code.
For this to work nicerly, get_code should return a String instead of Expr, then the formatting would be applied as a cleanup stage.
Writing a custom formatter/prettifier would be nice:
- re-indent some lines, especially those with macros placed in front of blocks or loops
- put empty lines between
block,for,ifandelseifif they are large - re-indent, or convert to short ternary form
a ? b : cif theifis small - remove useless parenthesis around functions placed within
Expr(e.g.:($f(a, b))->"(Mod.f)(a, b)"->"Mod.f(a, b)")
Metadata
Metadata
Assignees
Labels
No labels