{"id":18774717,"url":"https://github.com/sztheory/vsc-erlang-formatter","last_synced_at":"2025-04-13T09:21:46.580Z","repository":{"id":47919808,"uuid":"232514390","full_name":"szTheory/vsc-erlang-formatter","owner":"szTheory","description":"Erlang code formatter for Visual Studio Code","archived":false,"fork":false,"pushed_at":"2025-03-17T07:12:27.000Z","size":65,"stargazers_count":8,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T23:36:17.779Z","etag":null,"topics":["erlang","erlang-formatter","extension","formatter","rebar3","steamroller","visual-studio","visual-studio-code","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=szTheory.erlang-formatter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szTheory.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-08T08:22:39.000Z","updated_at":"2025-03-17T07:12:04.000Z","dependencies_parsed_at":"2024-11-07T19:41:35.226Z","dependency_job_id":"d049c4d2-074e-43a7-9fc5-431ea8d1aae3","html_url":"https://github.com/szTheory/vsc-erlang-formatter","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/szTheory%2Fvsc-erlang-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szTheory%2Fvsc-erlang-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szTheory%2Fvsc-erlang-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szTheory%2Fvsc-erlang-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szTheory","download_url":"https://codeload.github.com/szTheory/vsc-erlang-formatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248689376,"owners_count":21145923,"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":["erlang","erlang-formatter","extension","formatter","rebar3","steamroller","visual-studio","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-11-07T19:39:09.628Z","updated_at":"2025-04-13T09:21:46.549Z","avatar_url":"https://github.com/szTheory.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"images/erlang.png\" width=\"18\"\u003e Erlang Formatter for Visual Studio Code\n\n\u003e Automatically format your Erlang code.\n\n- [Features](#features)\n- [Setup](#setup)\n\n## Features\n\n### Auto format on Save\n\n![Auto format on save](https://user-images.githubusercontent.com/28652/72016514-d37fc400-325b-11ea-8a88-29608d198860.gif)\n\n## Setup\n\n### 1. Install the VSC extension\n\nInstall the Erlang Formatter from the Visual Studio Marketplace [from this link](https://marketplace.visualstudio.com/items?itemName=szTheory.erlang-formatter) or by searching from the Extensions tab within the app itself. If you have trouble finding it search for `erlang-formatter`.\n\n### 2. Install Rebar\n\nFollow the [official Rebar install instructions](https://www.rebar3.org/docs/getting-started) or use the commands below which will download rebar3 to a temporary directory and install it for your OS user.\n\n```bash\ncd ~/projects\ngit clone https://github.com/erlang/rebar3.git\ncd rebar3\n./bootstrap\n./rebar3 local install\n```\n\nThen add rebar3 to your PATH by putting it to your shell configuration file (for example `~/.zshrc` or `~/.bash_profile`).\n\n```bash\nexport PATH=$PATH:~/.cache/rebar3/bin\n```\n\n### 3a. Default formatter setup\n\nIf you just want to get up and running quickly, run the following command for a good default. Otherwise read the section below for more detail.\n\n```bash\necho -e \"{plugins, [rebar3_format]}.\" \u003e\u003e ~/.config/rebar3/rebar.config\n```\n\n**NOTE**: The first time you format your code it might take a few seconds if rebar3 hasn't already downloaded the formatter plugin.\n\n### 3b. Choosing a specific formatter\n\nThere are three main options for Erlang formatters right now. They are all written in Erlang and depend on rebar3. There's no community consensus on which to use, so you'll just have to pick one. Simply add the plugin to your project's `rebar.config` file, or set it up globally by adding it to `~/.config/rebar3/rebar.config` instead. Then you'll be able to format Erlang files anywhere without project configuration.\n\n- [rebar3_format](https://github.com/AdRoll/rebar3_format) - Highly configurable formatter\n\n```erlang\n{plugins, [rebar3_format]}.\n```\n\n- [Steamroller](https://github.com/old-reliable/steamroller) - Opinionated formatter with minimal configuration\n\n```erlang\n{plugins, [steamroller]}.\n```\n\n- [erlfmt](https://github.com/whatsapp/erlfmt) - Opinionated formatter with minimal configuration\n\n```erlang\n{plugins, [erlfmt]}.\n```\n\n### 4. Extension configuration\n\nAdd the extension config to your preferences file.\n\n- Open preferences (`Cmd/Ctrl + ,`)\n- Open `settings.json` (Click the icon at the top right with the document's corner being folded over to open the file)\n- Paste this in:\n\n```json\n\"[erlang]\": {\n  \"editor.defaultFormatter\": \"szTheory.erlang-formatter\",\n  \"editor.formatOnSave\": true\n},\n\"erlangFormatter.formatter\": \"rebar3_format\",\n```\n\n**NOTE**: If you want to use another formatter just replace `rebar3_format` with either `steamroller` or `erlfmt`.\n**NOTE**: You don't need to enable `formatOnSave`. If it's disabled then you can just manually select `Format Document` from the Command Palette (`Cmd/Ctrl + Shift + P`) in VS Code to run the formatter.\n\n## Links\n\n- [Erlang Formatter on the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=szTheory.erlang-formatter)\n\n## Thanks\n\nThanks to the authors of these projects, which were highly valuable resources.\n\n### Formatters\n\n- [rebar3_fmt](https://github.com/AdRoll/rebar3_format)\n- [Steamroller](https://github.com/old-reliable/steamroller)\n- [erlfmt](https://github.com/whatsapp/erlfmt)\n\n### Visual Studio Code Extensions\n\n- [Elixir Formatter](https://github.com/sarat-ravi/elixir-formatter)\n- [Elixir LS](https://github.com/elixir-lsp/vscode-elixir-ls)\n- [vscode-erlang-formatter](https://github.com/nwolverson/vscode-erlang-formatter)\n- [Erlang/OTP](https://github.com/yuce/erlang-vscode)\n\n## Releasing\n\n1. Bump the version number\n2. Update `CHANGELOG.md`\n3. `npm run test`\n4. `vsce package`\n5. `vsce publish`\n\nFor more info see [\"Publishing Extensions\"](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsztheory%2Fvsc-erlang-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsztheory%2Fvsc-erlang-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsztheory%2Fvsc-erlang-formatter/lists"}