JuliaFormatter.jl
Width-sensitive formatter for Julia code, inspired by gofmt, refmt, black, and prettier. Built with JuliaSyntax.jl.
Provides sane defaults out of the box, with a number of customisation options.
Admits a
.JuliaFormatter.tomlconfiguration file for project-level formatting settings.Can be used as a command-line app.
Quickstart
Traditionally, JuliaFormatter is invoked from the Julia REPL. (However, you may well find that the command-line jlfmt app is more convenient!)
To use JuliaFormatter from the REPL, install with:
]add JuliaFormatterThen you can do:
julia> using JuliaFormatter# Recursively formats all Julia files in the current directoryjulia> format(".")# Formats an individual filejulia> format_file("foo.jl")# Formats a stringjulia> format_text(str)