3[](https://circleci.com/gh/tweag/ormolu/tree/master)
5Ormolu is a formatter for Haskell source code. The project was created with
6the following features in mind:
8* Using GHC's own parser to avoid parsing problems caused by
9 [`haskell-src-exts`][haskell-src-exts].
10* Let some whitespace be programmable. The layout of the input
11 influence the layout choices in the output. This means that the
12 choices between single-line/multi-line layouts in each particular
13 situation are made by the user, not by an algorithm. This makes the
14 implementation simpler and leaves some control to the user while
15 still guaranteeing that the formatted code is stylistically
17* Writing code in such a way so it's easy to modify and maintain. Roughly,
18 it means that the project follows the path of [`hindent`][hindent] and is
19 very much about printing AST in a particular way.
20* Implementing one “true” formatting style which admits no configuration.
21* That formatting style aims to result in minimal diffs while still
22 remaining very close to “conventional” Haskell formatting people use.
23* Idempotency: formatting already formatted code doesn't change it.
24* Be well-tested and robust to the point that it can be used in large
25 projects without exposing unfortunate, disappointing bugs here and there.
29The easiest way to build the project is with Nix:
35Or with `cabal-install` from the Nix shell:
38$ nix-shell --run "cabal new-build"
41Alternatively, `stack` could be used with a `stack.yaml` file as follows.
54The following will print the formatted output to the standard output.
60Add `--mode inplace` to replace the contents of the input file with the
64$ ormolu --mode inplace Module.hs
67A configuration file can specify the language extensions to use by default.
76$ ormolu -c ormolu.yaml Module.hs
81See [CONTRIBUTING.md](./CONTRIBUTING.md).
85See [LICENSE.md](./LICENSE.md).
87Copyright © 2018–present Tweag I/O
89[haskell-src-exts]: https://hackage.haskell.org/package/haskell-src-exts
90[hindent]: https://hackage.haskell.org/package/hindent
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list