Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Uncrustify | 2,756 | 2 days ago | 1 | January 08, 2021 | 325 | gpl-2.0 | C++ | |||
Code beautifier | ||||||||||
Elm Format | 1,291 | 236 | 56 | 8 months ago | 28 | April 11, 2023 | 225 | bsd-3-clause | Haskell | |
elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide | ||||||||||
Cppstyle | 71 | 6 months ago | 17 | mit | Java | |||||
An Eclipse plugin that integrates clang-format and cpplint (cpplint.py) | ||||||||||
Ex_format | 40 | 6 years ago | 1 | August 24, 2017 | 13 | mit | Elixir | |||
ExFormat formats Elixir source code according to a standard set of rules | ||||||||||
Pydecker | 15 | 3 years ago | mit | Python | ||||||
Simple development tool that simplifies a pythonist's daily tasks. | ||||||||||
Js Format.el | 8 | 7 years ago | gpl-3.0 | Emacs Lisp | ||||||
Emacs package to format or transform code style using different javascript formatter (standard, jsbeautify, esformatter, etc.) | ||||||||||
Coding Style | 4 | 5 years ago | 1 | Python | ||||||
A Clang-Format config to respect EPITA coding style | ||||||||||
Uncrustify Objc | 2 | 2 years ago | mit | Shell | ||||||
Format Objective-C code with Uncrustify. |
elm-format
formats Elm source code
according to a standard set of rules based on the official Elm Style Guide.
It is inspired by the popular gofmt.
The benefits of elm-format
:
elm-format . # Format all *.elm files in the current directory
elm-format Main.elm # Format a single file
elm-format Main.elm --yes # Overwrite the file without prompting
elm-format src/ Main.elm # Format the listed files and directories
elm-format --help # See other command line options
To install elm-format
:
npm install -g elm-format
or download the version appropriate for your OS from the release page,
unzip it,
and place elm-format
or elm-format.exe
(windows) on your PATH
.
You must run elm-format
from the directory that contains your elm.json
(for Elm 0.19) or elm-package.json
(for Elm 0.18),
or else you must pass the appropriate --elm-version=0.19
/--elm-version=0.18
command line argument.
Find your editor in the table below. The recommended plugin for each editor is indicated with 🏆 (trophy emoji).
Editor | Plugin | Installation | Formatting | Format on save | Configuration | Error handling |
---|---|---|---|---|---|---|
Atom | 🏆 atom-elm-format | ✅ 2 steps | ✅ | ✅ | ✅ | ⚠️ no installation instructions |
atom-beautify | ⚠️ 3 steps | ✅ | ⚠️ requires configuration | ✅ | ✅ | |
Light Table | 🏆 elm-light | ⚠️ 3 steps | ✅ | ⚠️ requires configuration | ✅ | ⚠️ no installation instructions |
Vim | 🏆 elm-vim | ❌ 6 steps | ✅ | requires configuration | ✅ | ❌ no error message |
Emacs | 🏆 elm-mode | ❌ 4 steps | ✅ | ⚠️ requires configuration | ✅ | ⚠️ no installation instructions |
Visual Studio Code | 🏆 Elm Tooling | ⚠️ 3 steps | ✅ | ⚠️ requires configuration | ✅ | ❌ uninformative error message |
Sublime Text | 🏆 Elm Language Support | ✅ 2 steps | TBD | ✅ | TBD | TBD |
JetBrains (WebStorm, etc) | 🏆 intellij-elm | ⚠️ 4 steps | ✅ | ⚠️ requires configuration | ⚠️ requires configuration | TBD |
TextMate | 🏆 Elm.tmbundle | ✅ 2 steps | TBD | TBD | TBD | TBD |
These tools also integrate with elm-format:
If you can simplify or improve the installation instructions or add instructions for another editor, please make a pull request.
The default behavior of elm-format
-approved plugins is to format Elm files on save.
Install elm-format
Install atom-elm-format
apm install elm-format
or use the Atom package manager in Atom's settings
Install elm-format
Install atom-beautify
apm install atom-beautify
or use the Atom package manager in Atom's settings
^B
(CTRL-ALT-B
) to format a file[:editor.elm "ctrl-s" :save :elm-format :elm.lint]
Install elm-format
If your Emacs has package.el
(which is automatically the case for Emacs >= 24), you can install elm-mode
from the package in MELPA:
Ensure that you have added the MELPA source in your ~/.emacs.d/init.el
:
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
Install elm-mode (official instructions): Use M-x list-packages
and choose elm-mode
.
Add the following to your ~/.emacs.d/init.el
:
(add-hook 'elm-mode-hook 'elm-format-on-save-mode)
If you are an advanced vim user and already have a preferred vim plugin installation method, you may prefer to refer to the official elm-vim installation instructions. The instructions below are for those who need a step-by-step walkthrough of how to get the plugin set up.
Install elm-format
Install vim-plug (official instructions) NOTE: if you are using neovim, you will need to refer to the official instructions.
Download vim-plug:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Make sure ~/.vimrc
exists and has a section like this:
call plug#begin('~/.vim/plugged')
" ... any active plugins
call plug#end()
Install elm-vim (official instructions)
Plug 'elmcast/elm-vim'
to the plug#begin
plugin section in your ~/.vimrc
vim
and run :PlugInstall
Add the following to your ~/.vimrc
:
let g:elm_format_autosave = 1
Install elm-format
Install the extension Elm Plugin for Visual Studio Code.
Configure the extension to format on save:
settings.json
file (instructions).settings.json
:"[elm]": {
"editor.formatOnSave": true
},
This is for WebStorm and other JetBrains IDEs like IntelliJ and PyCharm.
Install elm-format
Install the intellij-elm plugin
In IntelliJ, open Settings -> Languages & Frameworks -> Elm
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Use the instructions below to get started.
More detailed information is available in ./dev/Documentation/
.
# check out the repo
git clone https://github.com/avh4/elm-format.git
cd elm-format
# initial setup
ghcup install ghc 9.4.4
ghcup set ghc 9.4.4
cabal install hpack
# build
dev/build.sh -- build
# run the built elm-format
./_build/bin/elm-format/O0/elm-format
See dev/Documentation
for more contributor and build command documentation.