Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Fatou Fatou logo

Fatou is a language server, formatter, and linter for the Julia language, written in Rust. It follows the rust-analyzer design (a lossless rowan CST, salsa for incremental computation, and lsp-server for the language-server transport) and is modeled on the author’s R tooling project, arity.

Status: early groundwork. The full architecture is in place; the parser covers a growing Julia subset, the formatter has started landing per-construct layout rules (gated by hand-authored fixtures), and no lint rules ship yet.

Quick Start

Install with Cargo:

cargo install fatou

Format your first file:

fatou format file.jl

For full installation options (npm, PyPI, prebuilt binaries, and source builds), see Getting Started.

Where to Go Next

Getting Started

Installation

Fatou runs on Linux, macOS, and Windows (x86_64 and arm64), and is available from several sources.

Cargo

Install from crates.io with Cargo:

cargo install fatou

npm

The fatou-cli package bundles a prebuilt binary:

npm install -g fatou-cli

PyPI

Install the binary as a Python tool:

uv tool install fatou
# or
pipx install fatou

Prebuilt binaries

Download an archive for your platform from the releases page and put the fatou binary on your PATH.

From source

Clone the repository and build a release binary:

git clone https://github.com/jolars/fatou
cd fatou
cargo build --release

The binary is written to target/release/fatou.

First Run

Format a file in place:

fatou format file.jl

Check formatting without writing changes (prints a diff, exits non-zero if any file would change):

fatou format --check file.jl

Lint a file (or pipe from stdin):

fatou lint --check file.jl

Run the language server over stdio (for editor integration):

fatou lsp

See the CLI Reference for the full set of commands and options, and Editor Setup to wire the language server into your editor.

Editor Setup

Fatou ships a language server (fatou lsp, stdio JSON-RPC) that already advertises document formatting and pushes parse diagnostics. This guide wires it into your editor so you can format Julia buffers and see parse errors inline.

Coverage is growing construct by construct; constructs without a formatting rule yet are left byte-identical, so formatting is always safe to run.

Prerequisites

Install Fatou (see Getting Started) and make sure the fatou binary is on your PATH, or note its absolute path.

Neovim

Neovim 0.11+ (built-in vim.lsp.config)

Add to your config (e.g. init.lua or a file under lua/):

vim.lsp.config("fatou", {
  cmd = { "fatou", "lsp" },              -- or the absolute path to the binary
  filetypes = { "julia" },
  root_markers = { "Project.toml", "JuliaProject.toml", ".git" },
})
vim.lsp.enable("fatou")

Format on save:

vim.api.nvim_create_autocmd("BufWritePre", {
  pattern = "*.jl",
  callback = function() vim.lsp.buf.format({ name = "fatou" }) end,
})

Older Neovim (autocmd + vim.lsp.start)

vim.api.nvim_create_autocmd("FileType", {
  pattern = "julia",
  callback = function(args)
    vim.lsp.start({
      name = "fatou",
      cmd = { "fatou", "lsp" },
      root_dir = vim.fs.root(args.buf, { "Project.toml", "JuliaProject.toml", ".git" }),
    })
  end,
})

Try it

Open a .jl file containing x=1, then run :lua vim.lsp.buf.format() (or just save with the autocmd above). It becomes x = 1. Parse errors, if any, appear as diagnostics (:lua vim.diagnostic.open_float()).

Notes

  • The server uses full-document sync and full-document formatting today; range formatting (textDocument/rangeFormatting) is on the roadmap.
  • Multiple formatters? vim.lsp.buf.format({ name = "fatou" }) forces Fatou even if another Julia LSP is attached.

Configuration

Fatou is configured with a TOML file named fatou.toml. All keys are optional; omitting a key uses its default. Unknown keys are rejected with an error, so a typo never silently falls back to a default.

Discovery

For a given file, Fatou looks for fatou.toml by walking up from the file’s directory through its ancestors, stopping at the first fatou.toml it finds.

On the command line:

  • --config <PATH> loads an explicit file and skips discovery.
  • --no-config ignores any discovered file and uses the built-in defaults.

[format]

KeyTypeDefaultDescription
line_widthinteger92The width the formatter tries to keep lines within.
indent_widthinteger4Number of spaces per indentation level.

Defaults follow common Julia conventions. Both keys can be overridden per run with the --line-width/--indent-width flags on fatou format.

[format]
line_width = 92
indent_width = 4

[lint]

KeyTypeDefaultDescription
selectarray of stringsunsetIf set, only these rule IDs run.
ignorearray of strings[]Rule IDs to disable.

Note: no lint rules ship yet, so [lint] is scaffolding today. The keys are accepted so a fatou.toml can be prepared ahead of the first rules landing.

[lint]
select = ["some-rule"]
ignore = ["another-rule"]

Command-Line Help for fatou

Fatou: a language server, formatter, and linter for Julia

Usage: fatou [OPTIONS] <COMMAND>

Options

--config <PATH>
Path to an explicit fatou.toml (skips discovery)
--no-config
Ignore any discovered fatou.toml and use built-in defaults

fatou parse

Parse and display the CST for debugging

Usage: fatou parse [OPTIONS] [FILE]

Arguments

<FILE>
Input file (stdin if not provided)

Options

--quiet

Suppress CST output to stdout

--verify

Verify parser losslessness (reconstruct(text) == text)

--to <TO>

Output representation: the lossless CST (default) or the JuliaSyntax s-expression projection (the parser oracle)

Default value: cst

Possible values:

  • cst: The lossless rowan concrete syntax tree
  • sexpr: The JuliaSyntax-native s-expression projection

fatou format

Format .jl files

Usage: fatou format [OPTIONS] [PATH]...

Arguments

<PATH>...
Input file(s) or path(s) (stdin if omitted)

Options

--check
Check formatting without writing; prints a diff and exits non-zero if any file would change
--line-width <N>
Override the target line width
--indent-width <N>
Override the indent width

fatou lint

Lint .jl files

Usage: fatou lint [OPTIONS] [PATH]...

Arguments

<PATH>...
Input file(s) or path(s)

Options

--check

Required in the groundwork phase: lint reports findings without writing fixes

--output <OUTPUT>

Output format

Default value: pretty

Possible values: pretty, concise, json

fatou lsp

Run the language server on stdio

Usage: fatou lsp