brittany
Format Haskell source code
TLDR
Format file and output to stdout
SYNOPSIS
brittany [options] [files]
DESCRIPTION
brittany is a Haskell source code formatter that focuses on horizontal space utilization. It reformats code to make maximal use of available width while avoiding lines that are too long.
The formatter uses ghc-exactprint as the parser, supporting full GHC Haskell including extensions.
PARAMETERS
--write-mode mode
Output mode: stdout, inplace, or display--check-mode
Exit with error if formatting would change--columns n
Maximum line width (default: 80)--indent n
Indentation width (default: 2)--config-file file
Use specific configuration file--no-user-config
Ignore user configuration file
CONFIGURATION
Default user config: ~/.config/brittany/config.yaml
Project config: First brittany.yaml found in current or parent directories.
GHC extensions can be enabled in config:
options_ghc:
- -XLambdaCase
- -XMultiWayIf
CAVEATS
Some less common Haskell syntax elements are not fully supported. In-source comments may occasionally be moved or lost. This project is effectively unmaintained; consider using Ormolu or Fourmolu instead.
SEE ALSO
ormolu(1), fourmolu(1), stylish-haskell(1), ghc(1)
