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
--- | --- | ---
Ada/SPARK |  |
Angular | prettier, oxfmt | prettier, oxfmtAUR
Ansible | ansible-lint --fix | ansible-lint
Arduino | clang-format | clang
Assembly |  |
Astrojs | biome | biome
Autotools |  |
AWK |  |
Bash | shfmt, beautysh | shfmt, beautyshAUR
Bazel | buildifier | buildifierAUR
Bicep | bicep format | bicepAUR
C# | csharpier | csharpierAUR
C3 |  |
C, C++, Objective-C | clang-format | clang
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, oxfmt | prettier, biome, oxfmtAUR
D | dfmt | dfmt
Dart | dart format | dart
Dhall | dhall format | dhall
Dockerfile, Dockercompose | dockerfmt | dockerfmtAUR
DOT |  |
Elixir | mix format | elixir
Elm | elm-format | elm-format-binAUR
Erlang | erlfmt | erlfmt-gitAUR
F# | fantomas | fantomas-binAUR
Fennel | fnlfmt | fnlfmt
Fish | fish_indent | fish
Flow | prettier | prettier
Fortran | fprettify | fprettifyAUR
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, gofumpt | go, gofumpt
GraphQL | prettier, biome, oxfmt | prettier, biome, oxfmtAUR
Groovy | npm-groovy-lint --format |
Haskell | ormolu, fourmolu, stylish-haskell, hindent | haskell-ormolu, haskell-fourmolu, stylish-haskell, hindent
Haxe | haxe-formatter |
HTML | prettier, biome, oxfmt | prettier, biome, oxfmtAUR
Hyprlang |  |
Janet | spork | janet-spork-gitAUR
Java | google-java-format, clang-format | google-java-formatAUR, clang
JavaScript | prettier, biome, oxfmt, deno fmt | prettier, biome, oxfmtAUR, deno
JSON | prettier, biome, jqlang, oxfmt, deno fmt | prettier, biome, jq, oxfmtAUR, deno
Julia | JuliaFormatter |
Just | just --fmt | just
KDL | kdlfmt | kdlfmtAUR
Kotlin | ktlint, ktfmt | ktlint, ktfmtAUR
Kubernetes |  |
Lean |  |
Lua | stylua, LuaFormatter | stylua, lua-formatAUR
Makefile | mbake | mbakeAUR
Markdown | prettier, mdformat, oxfmt, deno fmt | prettier, mdformat, oxfmtAUR, deno
Meson | meson format | meson
Mojo | mojo format | mojo-gitAUR
Nginx | nginx-config-formatter, nginxbeautifier | nginx-config-formatterAUR, nginxbeautifierAUR
Nickel |  |
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
Pony |  |
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
RST |  |
Ruby | rubocop | rubocop
Rust | rustfmt | rust
Scala | scalafmt | scalafmtAUR
Solidity |  |
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
Systemd |  |
SystemVerilog | verible | veribleAUR
Tcl |  |
Terraform | terraform fmt | terraform
(La)TeX | tex-fmt, latexindent | tex-fmtAUR, texlive-binextra
TOML | taplo, tombi, oxfmt | taplo-cli, tombi, oxfmtAUR
TypeScript | prettier, biome, oxfmt, deno fmt | prettier, biome, oxfmtAUR, deno
Typst | typstyle | typstyle
V | v fmt | vlangAUR
Vala |  |
Vimscript |  |
Vue | prettier, biome, oxfmt | prettier, biome, oxfmtAUR
WebAssembly |  |
XML | tidy, xmlformatter | tidy, python-xmlformatterAUR
YAML | yamlfmt, prettier, yamlfix, oxfmt | yamlfmt, prettier, yamlfixAUR, oxfmtAUR
Zig | zig fmt | zig
Zsh | shfmt | shfmt

Category:

- Programming languages

Formatter
Add topic