domluna/juliaformatter.jl

An opinionated code formatter for Julia. Plot twist - the opinion is your own.

643

stars

949

commits

Julia

primary language

Sep 6, 2026

updated

juliaeditorsupport.github.io/JuliaFormatter.jl/
cst
formatter
formatting
julia

README

JuliaFormatter.jl

Documenter: stable Build Status

Width-sensitive formatter for Julia code. Inspired by gofmt, refmt, and black.

[!NOTE] In JuliaFormatter v2, SciMLStyle and YASStyle still have a number of rough edges. If you are using these styles please consider using v1 of JuliaFormatter.

Default and Blue styles should largely be stable from v2.10 onwards.

See also the Project Status section of the docs for more details.

Installation

pkg> add JuliaFormatter

Quick Start

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 (contents of a Julia file)
julia> format_text(str)

Check out the docs for further description of the formatter and its options.

Command Line Tool

Starting from version 2.2.0, JuliaFormatter provides a command-line executable jlfmt.

To install:

pkg> app add JuliaFormatter

Usage:

# Format a file and write to stdout
jlfmt src/file.jl

# Format a file in place
jlfmt --inplace src/file.jl

# Check if all files in a directory are already formatted with verbose mode
jlfmt --check -v src/

# Format all files in a directory with multiple threads
jlfmt --threads=6 -- --inplace -v src/

# Show diff without modifying files
jlfmt --diff src/file.jl

Run jlfmt --help for more options.

Check out the CLI docs for further description of the formatter and its options.

Contributors

(top 30 of 67)

domluna

646 commits

penelopeysm

140 commits

aviatesk

24 commits

pfitzseb

11 commits

domluna/juliaformatter.jl

An opinionated code formatter for Julia. Plot twist - the opinion is your own.

643

stars

949

commits

Julia

primary language

Sep 6, 2026

updated

juliaeditorsupport.github.io/JuliaFormatter.jl/
cst
formatter
formatting
julia

README

JuliaFormatter.jl

Documenter: stable Build Status

Width-sensitive formatter for Julia code. Inspired by gofmt, refmt, and black.

[!NOTE] In JuliaFormatter v2, SciMLStyle and YASStyle still have a number of rough edges. If you are using these styles please consider using v1 of JuliaFormatter.

Default and Blue styles should largely be stable from v2.10 onwards.

See also the Project Status section of the docs for more details.

Installation

pkg> add JuliaFormatter

Quick Start

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 (contents of a Julia file)
julia> format_text(str)

Check out the docs for further description of the formatter and its options.

Command Line Tool

Starting from version 2.2.0, JuliaFormatter provides a command-line executable jlfmt.

To install:

pkg> app add JuliaFormatter

Usage:

# Format a file and write to stdout
jlfmt src/file.jl

# Format a file in place
jlfmt --inplace src/file.jl

# Check if all files in a directory are already formatted with verbose mode
jlfmt --check -v src/

# Format all files in a directory with multiple threads
jlfmt --threads=6 -- --inplace -v src/

# Show diff without modifying files
jlfmt --diff src/file.jl

Run jlfmt --help for more options.

Check out the CLI docs for further description of the formatter and its options.

Contributors

(top 30 of 67)

domluna

646 commits

penelopeysm

140 commits

aviatesk

24 commits

pfitzseb

11 commits

Languages

Julia

99.8%