JuliaFormatter.jl

Width-sensitive formatter for Julia code, inspired by gofmt, refmt, black, and prettier. Built with JuliaSyntax.jl.

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 JuliaFormatter

Then 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)