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 directory
julia> format(".")
# Formats an individual file
julia> format_file("foo.jl")
# Formats a string
julia> format_text(str)