{"id":20639020,"url":"https://github.com/uohzxela/ex_format","last_synced_at":"2025-04-15T22:49:55.004Z","repository":{"id":62429144,"uuid":"84782229","full_name":"uohzxela/ex_format","owner":"uohzxela","description":"ExFormat formats Elixir source code according to a standard set of rules","archived":false,"fork":false,"pushed_at":"2017-10-17T10:42:59.000Z","size":5587,"stargazers_count":39,"open_issues_count":13,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-15T22:49:46.645Z","etag":null,"topics":["code-style","elixir","formatter","pretty-printer"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/uohzxela.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-13T03:57:06.000Z","updated_at":"2022-12-09T17:45:45.000Z","dependencies_parsed_at":"2022-11-01T20:08:35.195Z","dependency_job_id":null,"html_url":"https://github.com/uohzxela/ex_format","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/uohzxela%2Fex_format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uohzxela%2Fex_format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uohzxela%2Fex_format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uohzxela%2Fex_format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uohzxela","download_url":"https://codeload.github.com/uohzxela/ex_format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167434,"owners_count":21223505,"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":["code-style","elixir","formatter","pretty-printer"],"created_at":"2024-11-16T15:21:54.949Z","updated_at":"2025-04-15T22:49:54.986Z","avatar_url":"https://github.com/uohzxela.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExFormat\n\n[![Hex.pm](https://img.shields.io/hexpm/v/ex_format.svg)](https://hex.pm/packages/ex_format)\n\nExFormat formats Elixir source code according to a standard set of rules based on the [elixir-style-guide](https://github.com/lexmag/elixir-style-guide). It tries its best to accommodate the user's intent by preserving intended layout and syntax. The documentation is available [online](https://hexdocs.pm/ex_format/0.1.0/api-reference.html).\n\nNote: ExFormat is a prototype. For a production-ready version, please have a look at the [latest code formatter](https://github.com/whatyouhide/code_formatter) that's under development by the Elixir core team. \n\n## Requirements\n\n- Erlang/OTP 20\n- Mix v1.5.1\n\n## Installation\n\nAs ExFormat works best with the unreleased Elixir v1.6, it is recommended to download the prebuilt escript (which embeds Elixir v1.6 in itself) and run it as an executable.\n\n```sh\nmix escript.install https://github.com/uohzxela/ex_format/raw/master/ex_format\n```\n\nIf you haven't done so already, consider adding `~/.mix/escripts` directory to your `PATH` environment variable.\n\n## Usage\n\n```sh\n# Change directory to your Elixir project\ncd to/your/elixir/project\n\n# Formats all files that match each wildcard\nex_format lib/**/*.ex config/**/*.exs\n```\n\n## Background info\n\nFor those who are curious, the formatter is created by following these steps:\n\n1. Parse source code into AST\n2. Augment the AST nodes with metadata such comments and line breaks\n3. Do a recursive descent on the AST starting from the topmost node\n4. Pattern match on each node, format it according to the style guide and continue to recurse down its children nodes\n\nHence, conceptually, this is a very simple formatter and is a good example of how pattern matching works in practice.\n\nThere are also contributions to Elixir tokenizer and parser to augment the AST with the necessary metadata for formatting, you can check these out [here](https://github.com/elixir-lang/elixir/commits?author=uohzxela).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuohzxela%2Fex_format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuohzxela%2Fex_format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuohzxela%2Fex_format/lists"}