Side by side
Ormolu vs shfmt
Both stand on code formatting tools. Which one you can start free with, which one lets you read the code, and what each costs once you pay.
Free plan LinuxMacWeb+1
Ormolu provides a single-style formatter for Haskell with command-line, browser, editor, and language-server paths. Its fixed style may not fit projects that need configurable formatting, and CPP handling is limited.
Visit Ormolu Free plan LinuxMacSelf-hosted+1
Choose shfmt for free shell formatting and syntax checking across its supported shell dialects, especially if you want directory processing or editor integration. Its key constraint is that formatting cannot be turned off for selected line ranges; the project also aims to keep its option set limited.
Visit shfmtThe facts
| Ormolu | shfmt | |
|---|---|---|
| Free plan | Yes | Yes |
| Open source | Not published | Not published |
| Runs on | Linux, Mac, Web, Windows | Linux, Mac, Self-hosted, Windows |
| Lowest paid plan | Free or on request | Free or on request |
| Plans published | 1 | 1 |
| Maker | Not published | Not published |
| Website | github.com | github.com |
| On code formatting tools | #14 of 34 | #18 of 34 |
Ormolu: what it does well
- Uses GHC's parser
- Offers binaries for Linux, macOS, and Windows
- Works with Emacs, VS Code, and Vim integrations
- Haskell Language Server has built-in formatter support
- Can read defaults from a matching Cabal file
What to know first
- Formatting style cannot be configured
- CPP support is experimental
- CPP support is limited to simple top-level conditionals
shfmt: what it does well
- Free and open source, with no paid plan stated.
- Supports POSIX Shell, Bash, Zsh, mksh, and Bats.
- Formats files, standard input, and directories recursively.
- Can list, write, or diff files with formatting differences.
- Reads options from EditorConfig when flags are absent.
What to know first
- Cannot disable formatting for selected line ranges.
- Requires valid UTF-8 for static syntax parsing.