Formatter - ArchWiki

Jump to content

# Formatter

From ArchWiki

Related articles

- Language Server Protocol
- Lint
- Debug adapter protocol

A formatter is a program that automatically indents program source code according to some rules, either predefined or declared in a configuration file.

A formatter for your programming language can be installed natively using the following packages.

Tip If your language is not in the list, search in the Arch official repositories or in the AUR. Some programming languages have their own package registry and you may have better luck finding formatter for that language there if it is not packaged in the Arch official repositories or AUR. Lastly, you can try package mangers focusing on development tools like Nix or mise.
Note

- If you want to integrate a formatter into your text editor (e.g. add format-on-save functionality), refer to Language Server Protocol page. Some Language Servers provide formatting functionality built in, while others require external formatting provider. In such case, look for it in this list.
- Some programming languages provide a formatter out of the box, so you only need to install the package for their official compiler/interpreter or build system. If this is the case, it will be listed here as "Formatter package".

Language | Formatter | Formatter package
--- | --- | ---
Angular | prettier | prettier
Arduino | clang-format | clang
Ansible | ansible-lint --fix | ansible-lint
Assemblly |  |
Astrojs | biome | biome
Bash | shfmt, beautysh | shfmt, beautyshAUR
Bazel | buildifier | buildifierAUR
Bicep | bicep format | bicepAUR
C, C++, Objective-C | clang-format | clang
C# | csharpier | csharpierAUR
Cabal | cabal-fmt | cabal-fmt
Clojure | cljfmt, joker, cljstyle, zprint | cljfmt-binAUR, joker-binAUR, cljstyle-binAUR, zprint-binAUR
CMake | cmake_format, gersemi | cmake-formatAUR, python-gersemi
Crystal | crystal tool format | crystal
CSS, LESS, SASS | prettier, biome | prettier, biome
D | dfmt | dfmt
Dart | dart format | dart
Dhall | dhall format | dhall
Dockerfile, Dockercompose | dockerfmt | dockerfmtAUR
Elixir | mix format | elixir
Elm | elm-format | elm-format-binAUR
Erlang | erlfmt | erlfmt-gitAUR
Fennel | fnlfmt | fnlfmt
Fish | fish_indent | fish
Flow | prettier | prettier
Fortran | fprettify | fprettifyAUR
F# | fantomas | fantomas-binAUR
GDScript | gdscript-formatter, gdtoolkit | gdscript-formatter-binAUR, python-gdtoolkitAUR
General purpose | prettier, uncrustify, astyle, clang-format | prettier, uncrustify, astyle, clang
Gleam | gleam format | gleam
GOlang | go fmt | go
GraphQL | prettier, biome | prettier, biome
Groovy | npm-groovy-lint --format |
Haskell | ormolu, fourmolu, stylish-haskell, hindent | haskell-ormolu, haskell-fourmolu, stylish-haskell, hindent
Haxe | haxe-formatter |
HTML | prettier, biome | prettier, biome
Janet | spork | janet-spork-gitAUR
JavaScript | prettier, biome | prettier, biome
Java | google-java-format, clang-format | google-java-formatAUR, clang
JSON | prettier, biome, jqlang | prettier, biome, jq
Julia | JuliaFormatter |
Just | just --fmt | just
KDL | kdlfmt | kdlfmtAUR
Kotlin | ktlint, ktfmt | ktlint, ktfmtAUR
Lua | stylua, LuaFormatter | stylua, lua-formatAUR
Makefile | mbake | mbakeAUR
Markdown | prettier, mdformat | prettier, mdformat
Meson | meson format | meson
Mojo | mojo format | mojo-gitAUR
Nginx | nginx-config-formatter | nginx-config-formatterAUR
Nim | nimpretty, nph | nim, nph-binAUR
nix | nixfmt | nixfmtAUR
Nushell | numft |
OCaml, Reason | dune fmt | dune
Odin | odinfmt | odinfmt
OmniSharp |  |
Perl | perltidy | perl-tidy
PHP | php-cs-fixer, mago, pretty-php | php-cs-fixerAUR, magoAUR, pretty-phpAUR
Pkl | pkl format | pklAUR
PowerShell | PSScriptAnalyzer |
PureScript | purescript-tidy |
Python | black, ruff | python-black, ruff
QML | qmlformat | qt5-declarative
R | air, styler, formatR | r-air-binAUR, r-stylerAUR, r-formatrAUR
Racket | raco fmt |
ReScript | rescript format |
Roc | roc fmt | roc-nightly-binAUR
Rust | rustfmt | rust
Ruby | rubocop | rubocop
Scala | scalafmt | scalafmtAUR
SQL | sqlfluff, sqlparse, sqruff, sqlfmt, sql-formatter | sqlfluff, python-sqlparse, sqruff-binAUR, sqlfmt-binAUR, sql-formatterAUR
Standard ML | smlfmt | smlfmtAUR
Svelte | biome | biome
Swift | swift-format | swift-formatAUR
SystemVerilog | verible | veribleAUR
Terraform | terraform fmt | terraform
(La)TeX | tex-fmt, latexindent | tex-fmtAUR, texlive-binextra
TOML | taplo, tombi | taplo-cli, tombi
TypeScript | prettier, biome | prettier, biome
Typst | typstyle | typstyle
V | v fmt | vlangAUR
Vala |  |
Vue | prettier, biome | prettier, biome
WebAssembly | wasm-language-tools | wasm-language-toolsAUR
XML | tidy, xmlformatter | tidy, python-xmlformatterAUR
YAML | yamlfmt, prettier, yamlfix | yamlfmt, prettier, yamlfixAUR
Zig | zig fmt | zig
Zsh | shfmt | shfmt

Category:

- Programming languages

Formatter
Add topic