{"id":15059648,"url":"https://github.com/nukisman/elm-format-short","last_synced_at":"2025-10-04T18:31:55.396Z","repository":{"id":57222605,"uuid":"104549090","full_name":"nukisman/elm-format-short","owner":"nukisman","description":"elm-format-short formats Elm source code according to a standard set of rules in shorter way than elm-format.","archived":false,"fork":true,"pushed_at":"2017-10-02T00:55:44.000Z","size":2389,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-03T09:16:44.960Z","etag":null,"topics":["elm","elm-format","elm-lang","elm-language","format","formatter","source-code"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/elm-format-short","language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"avh4/elm-format","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nukisman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-23T07:15:53.000Z","updated_at":"2021-09-13T15:43:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nukisman/elm-format-short","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukisman%2Felm-format-short","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukisman%2Felm-format-short/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukisman%2Felm-format-short/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukisman%2Felm-format-short/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nukisman","download_url":"https://codeload.github.com/nukisman/elm-format-short/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235289313,"owners_count":18965921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elm","elm-format","elm-lang","elm-language","format","formatter","source-code"],"created_at":"2024-09-24T22:46:15.537Z","updated_at":"2025-10-04T18:31:54.799Z","avatar_url":"https://github.com/nukisman.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# elm-format-short\n\n\u003e `elm-format-short` is still in alpha.  If you run into any problems, please [report them](https://github.com/nukisman/elm-format-short/issues).\n\u003e\n\u003e **The format produced by elm-format-short may change significantly before the 1.0.0 release.**  \nIf this will cause problems for you, please refrain from using elm-format-short during the alpha- and beta-test periods.\n\nSee [https://github.com/nukisman/elm-format-short](https://github.com/nukisman/elm-format-short)\n\n`elm-format-short` formats your code like `elm-format` but: \n* Without extra blank lines\n* Without extra line breaks\n* Without extra indents\n* With shorter and better visual representations of `case-of`, `if-then-else`, `let-in`, etc.\n    \n`elm-format-short` formats [Elm](http://elm-lang.org) source code according to a standard set of rules in shorter way than `elm-format`.\n\nThe benefits of `elm-format-short` are same as of `elm-format`:\n - It makes code **easier to write**, because you never have to worry about minor formatting concerns while powering out new code.\n - It makes code **easier to read**, because there are no longer distracting minor stylistic differences between different code bases. As such, your brain can map more efficiently from source to mental model.\n - It makes code **easier to maintain**, because you can no longer have diffs related only to formatting; every diff necessarily involves a material change.\n - It **saves your team time** debating how to format things, because there is a standard tool that formats everything the same way.\n - It **saves you time** because you don't have to nitpick over formatting details of your code.\n\nplus benefits in contrast to `elm-format`:\n - It makes code **easier to read**, because you can see more code without scrolling.\n - It makes code **easier to navigate**, because you have not to scroll needless empty space by mouse or arrows on keyboard.\n - It makes code **easier to write**, because it is **easier to read** and **easier to navigate**.\n - It makes code **easier to debug**, because your lines of code commented out for debug purposes are not surrounded by needless blank lines above and below.\n - It **saves your money**, because you can still use your display. It not require you to buy new display with vertical resolution of 1000000000 pixels to see tons of blank lines.\n\n## Example formatting\n\nSee `dreamwriter` app by `@rtfeldman`:\n - [Editor.elm](tests/test-files/good/rtfeldman/dreamwriter/Editor.elm)\n - [LeftSidebar.elm](tests/test-files/good/rtfeldman/dreamwriter/LeftSidebar.elm)\n - [RightSidebar.elm](tests/test-files/good/rtfeldman/dreamwriter/RightSidebar.elm)\n - [WordGraph.elm](tests/test-files/good/rtfeldman/dreamwriter/WordGraph.elm)  \n  \n## Usage (same as elm-format)\n\n```bash\nelm-format-short Main.elm  # Format a single file\nelm-format-short Main.elm --yes  # Overwrite the file without prompting\nelm-format-short src/  # Format all *.elm files in a directory\nelm-format-short --stdin  # Format input from stdin and write to stdout\nelm-format-short --stdin --output Main.elm  # Format input from stdin and write to file\nelm-format-short --help  # See other command line options\n```\n\n---\n\n\n## Installation (currently Mac and Linux only) \n\n`npm i -g elm-format-short`\n\n## IDE Integration\n\n`elm-format-short` is CLI-compatible with `elm-format`. IDE Integration almost same as for `elm-format`.\n\n### JetBrains Integration\n\nThis is for WebStorm and other JetBrains IDEs.\n\n1. Install `elm-format-short`\n1. Install the [Elm Language Plugin](https://durkiewicz.github.io/elm-plugin/) package.\n1. Install the File Watchers plugin (available in the plugin repository)\n1. Add a file watcher for .elm files with the settings as [shown here](img/JetBrains%20setup.png).\n1. Set tab/indent size to 2 spaces as [shown here](img/JetBrains%20setup%20tabsize.png)\n \n---\n\n--- \n\n# TODO: Update this document for elm-format-short\n\n### Experimental version\n\nThe latest version of `elm-format` contains experimental features that may or may not appear in future releases.\nIf you are able to some amount of instability on your Elm projects,\nyou can help with the development of `elm-format` by using the experimental version and providing feedback.\nYou can give feedback about the latest experimental version [here](https://goo.gl/forms/kLdTN1yikfOI8ZuA3).\n\nTo install the experimental version:\n\n```sh\nnpm install -g elm-format@exp\n```\n\nor download the version appropriate for your OS from the [release page](https://github.com/avh4/elm-format/releases/tag/0.7.0-exp),\nunzip it,\nand place `elm-format` or `elm-format.exe` (windows) on your `PATH`.\n\n\n## Editor integration\n\n\u003c!-- Open-source editors will be listed before closed-source editors. --\u003e\n\nFind your editor in the table below.  The recommended plugin for each editor is indicated with :trophy: (trophy emoji).\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eEditor\u003c/th\u003e\n    \u003cth\u003ePlugin\u003c/th\u003e\n    \u003cth\u003eInstallation\u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://github.com/avh4/elm-format/issues/104\"\u003eFormatting\u003c/a\u003e\u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://github.com/avh4/elm-format/issues/104\"\u003eFormat on save\u003c/a\u003e\u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://github.com/avh4/elm-format/issues/104\"\u003eConfiguration\u003c/a\u003e\u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://github.com/avh4/elm-format/issues/104\"\u003eError handling\u003c/a\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=2\u003e\u003ca href=\"https://atom.io/\"\u003eAtom\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://atom.io/packages/elm-format\"\u003eatom-elm-format\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark: \u003ca href=\"#atom-elm-format-installation\"\u003e2 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:warning: must use format-on-save or save file before formatting\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:warning: no installation instructions\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003c!-- Atom --\u003e\n    \u003ctd\u003e\u003ca href=\"https://atom.io/packages/atom-beautify\"\u003eatom-beautify\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:warning: \u003ca href=\"#atom-beautify-installation\"\u003e3 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:warning: requires configuration\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=1\u003e\u003ca href=\"http://lighttable.com/\"\u003eLight Table\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://github.com/rundis/elm-light\"\u003eelm-light\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:warning: \u003ca href=\"#elm-light-installation\"\u003e3 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:warning: requires configuration\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:warning: no installation instructions\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=1\u003eVim\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://github.com/ElmCast/elm-vim\"\u003eelm-vim\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:x: \u003ca href=\"#elm-vim-installation\"\u003e6 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e⚠️ requires configuration\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:x: no error message\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=1\u003eEmacs\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://github.com/jcollard/elm-mode\"\u003eelm-mode\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:x: \u003ca href=\"#elm-mode-installation\"\u003e4 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:warning: requires configuration\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e:warning: no installation instructions\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=2\u003eVisual Studio Code\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=sbrink.elm\"\u003eElm Language Support\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:warning: \u003ca href=\"#visual-studio-code-installation\"\u003e3 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e:warning: requires configuration\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003c!-- Visual Studio Code --\u003e\n    \u003ctd\u003e\u003ca href=\"https://marketplace.visualstudio.com/items?itemName=abadi199.elm-format\"\u003eVSCode Elm Format\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:warning: \u003ca href=\"#vscode-elm-format-installation\"\u003e3 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e:warning: requires configuration\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=1\u003eSublime Text\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://packagecontrol.io/packages/Elm%20Language%20Support\"\u003eElm Language Support\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark: \u003ca href=\"#sublime-text-installation\"\u003e2 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=1\u003eJetBrains (WebStorm, etc)\u003c/td\u003e\n    \u003ctd\u003e:trophy: \u003ca href=\"https://durkiewicz.github.io/elm-plugin/\"\u003eElm Language Plugin\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e:warning: \u003ca href=\"#jetbrains-installation\"\u003e4 steps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e:white_check_mark:\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n    \u003ctd\u003e❔ TBD\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Detailed instructions\n\nIf you can simplify or improve the installation instructions or add instructions for another editor, please [make a pull request](https://github.com/avh4/elm-format/edit/master/README.md).\nThe default behavior of `elm-format`-approved plugins is to format Elm files on save.\n\n\n### atom-elm-format installation\n\n1. Install elm-format\n1. Install atom-elm-format\n\n    ```\n    apm install elm-format\n    ```\n\n  or use the Atom package manager in Atom's settings\n\n\n### atom-beautify installation\n\n1. Install elm-format\n1. Install atom-beautify\n\n    ```\n    apm install atom-beautify\n    ```\n\n  or use the Atom package manager in Atom's settings\n\n1. Use `^⌥B` (`CTRL-ALT-B`) to format a file\n\n\n### elm-light installation\n\n1. Install elm-format\n1. Install the [elm-light plugin](https://github.com/rundis/elm-light) using the Light Table plugin manager\n1. To format on save, edit your user keymap by performing the following:\n  * Click File -\u003e Settings -\u003e User Keymap to open the user keymap.\n  * Copy the following line and paste it into your keymap. Anywhere is fine as long as it is whithin the outer brackets. Ensure to save the file.\n  ```clojure\n  [:editor.elm \"ctrl-s\" :save :elm-format :elm.lint]\n  ```\n  * Search for \"App: Reload keymaps\" in the Commands Window to apply the changes (or restart LightTable).\n\n\n### elm-mode installation\n\n1. Install elm-format\n1. If your Emacs has `package.el` (which is automatically the case for Emacs \u003e= 24), you can install `elm-mode` from the package in [MELPA](http://melpa.milkbox.net/):\n\n    1. Ensure that you have added the MELPA source in your `~/.emacs.d/init.el`:\n\n        ```lisp\n        (require 'package)\n        (add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))\n        ```\n\n    1. Install elm-mode ([official instructions](https://github.com/jcollard/elm-mode#installation)): Use `M-x list-packages` and choose `elm-mode`.\n\n1. Set `elm-format-on-save` to `t` to apply elm-format on the current buffer on every save. (The setting can be changed via `M-x customize-variable elm-format-on-save`. Click button `Toggle` to change the setting and button `State` to activate the setting.)\n\n\n### elm-vim installation\n\n1. Install elm-format\n1. Install [vim-plug](https://github.com/junegunn/vim-plug) ([official instructions](https://github.com/junegunn/vim-plug#installation))\n\n    1. Download vim-plug:\n\n        ```bash\n        curl -fLo ~/.vim/autoload/plug.vim --create-dirs \\\n            https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\n        ```\n\n   1. Make sure there is a section like this in your `~/.vimrc`:\n\n        ```vim\n        call plug#begin('~/.vim/plugged')\n        \" ... any active plugins\n        call plug#end()\n        ```\n\n\n\n1. Install elm-vim ([official instructions](https://github.com/ElmCast/elm-vim#install))\n\n    1. Add `Plug 'elmcast/elm-vim'` to the `plug#begin` plugin section in your `~/.vimrc`\n    1. Start `vim` and run `:PlugInstall`\n\n1. Add the following to your `~/.vimrc`:\n\n  ```\n  let g:elm_format_autosave = 1\n  ```\n\n\n### Visual Studio Code installation\n\n1. Install elm-format\n1. Install Elm tools for VSCode\n\n    ```bash\n    ext install elm\n    ```\n\n1. SHIFT-ALT-F will format the current file\n\n\n### VSCode Elm Format installation\n\n1. Install elm-format\n1. Install VSCode Elm Format\n\n    ```bash\n    ext install elm-format\n    ```\n\n1. You can run elm-format by using the `Elm: Format` command\n1. You can also run elm-format whenever you save the file by adding `formatOnSave: true` option to your [settings.json](https://code.visualstudio.com/docs/customization/userandworkspace) file.\n\n\n\n### Sublime Text installation\n\n1. Install elm-format\n1. Install the [Elm Language Support](https://packagecontrol.io/packages/Elm%20Language%20Support) package.\n\n\n### JetBrains installation\n\nThis is for WebStorm and other JetBrains IDEs.\n\n1. Install elm-format\n1. Install the [Elm Language Plugin](https://durkiewicz.github.io/elm-plugin/) package.\n1. Install the File Watchers plugin (available in the plugin repository)\n1. Add a file watcher for .elm files with the settings as [shown here](img/JetBrains%20setup.png).\n\n\n## Development info\n\nPlease note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n\n### Building from source\n\n```bash\nbrew install haskell-stack\ngit clone https://github.com/avh4/elm-format.git\ncd elm-format\nstack setup\nstack build\nstack install\n~/.local/bin/elm-format-0.18 --help\n```\n\n### Running tests\n\n```bash\nbrew install shellcheck\n./tests/run-tests.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnukisman%2Felm-format-short","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnukisman%2Felm-format-short","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnukisman%2Felm-format-short/lists"}