{"id":13143729,"url":"https://github.com/ab22593k/lua-format","last_synced_at":"2026-02-01T18:35:58.224Z","repository":{"id":127939958,"uuid":"304322128","full_name":"ab22593k/lua-format","owner":"ab22593k","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-13T05:43:49.000Z","size":2795,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-14T13:01:36.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ab22593k.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,"governance":null}},"created_at":"2020-10-15T12:40:13.000Z","updated_at":"2021-01-13T05:49:36.000Z","dependencies_parsed_at":"2023-09-10T05:52:37.233Z","dependency_job_id":null,"html_url":"https://github.com/ab22593k/lua-format","commit_stats":null,"previous_names":["a6delwaha6z/lua-format","abdelwahabzbal/lua-format","ab22593k/lua-format","awh6al/lua-format"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab22593k%2Flua-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab22593k%2Flua-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab22593k%2Flua-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab22593k%2Flua-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ab22593k","download_url":"https://codeload.github.com/ab22593k/lua-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242374386,"owners_count":20117635,"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":[],"created_at":"2024-07-27T03:24:27.140Z","updated_at":"2026-02-01T18:35:58.209Z","avatar_url":"https://github.com/ab22593k.png","language":"C++","funding_links":[],"categories":["Projects"],"sub_categories":[],"readme":"# LuaFormatter\n\nReformats your Lua source code.\n\n[![Build Status (Linux / MacOS)](https://travis-ci.org/Koihik/LuaFormatter.svg?branch=master)](https://travis-ci.org/Koihik/LuaFormatter)\n[![Build status (Windows)](https://ci.appveyor.com/api/projects/status/to7uvpkdgj96aumg/branch/master?svg=true)](https://ci.appveyor.com/project/Koihik/luaformatter/branch/master)\n[![codecov](https://codecov.io/gh/Koihik/LuaFormatter/branch/master/graph/badge.svg)](https://codecov.io/gh/Koihik/LuaFormatter)\n\n## Editor support\n\n* VS Code: https://github.com/Koihik/vscode-lua-format\n* Sublime: https://github.com/Koihik/sublime-lua-format\n* Vim:     https://github.com/andrejlevkovitch/vim-lua-format\n\n## Install\n\n### LuaRocks\n\nThe easiest way to install is to use [LuaRocks](https://github.com/luarocks/luarocks).\n\n```bash\nluarocks install --server=https://luarocks.org/dev luaformatter\n```\n\n### Build from source\n\n#### Requirements\n* cmake 3.9+\n* c++ 17 compiler\n* luarocks 3.3.0+\n\n#### Steps\n```bash\n    git clone --recurse-submodules https://github.com/Koihik/LuaFormatter.git\n    cd LuaFormatter\n    cmake .\n    make\n    make install\n```\n\n## Usage\n\n```\n  ./lua-format [Lua scripts...] {OPTIONS}\n\n    Reformats your Lua source code.\n\n  OPTIONS:\n\n      -h, --help                             Display this help menu\n      -v, --verbose                          Turn on verbose mode\n      -i                                     Reformats in-place\n      --dump-config                          Dumps the default style used to stdout\n      -c[file], --config=[file]              Style config file\n      Lua scripts...                         Lua scripts to format\n      --column-limit=[column limit]          Column limit of one line\n      --indent-width=[indentation\n      width]                                 Number of spaces used for indentation\n      --tab-width=[tab width]                Number of spaces used per tab\n      --continuation-indent-width=[Continuation\n      indentation width]                     Indent width for continuations line\n      --spaces-before-call=[spaces\n      before call]                           Space on function calls\n      --column-table-limit=[column\n      table limit]                           Column limit of each line of a table\n      --table-sep=[table separator]          Character to separate table fields\n      This group is all exclusive:\n        --use-tab                            Use tab for indentation\n        --no-use-tab                         Do not use tab for indentation\n      This group is all exclusive:\n        --keep-simple-control-block-one-line\n                                             keep block in one line\n        --no-keep-simple-control-block-one-line\n                                             Do not keep block in one line\n      This group is all exclusive:\n        --keep-simple-function-one-line      keep function in one line\n        --no-keep-simple-function-one-line\n                                             Do not keep function in one line\n      This group is all exclusive:\n        --align-args                         Align the arguments\n        --no-align-args                      Do not align the arguments\n      This group is all exclusive:\n        --break-after-functioncall-lp        Break after '(' of function call\n        --no-break-after-functioncall-lp     Do not break after '(' of function call\n      This group is all exclusive:\n        --break-before-functioncall-rp       Break before ')' of function call\n        --no-break-before-functioncall-rp    Do not break before ')' of function call\n      This group is all exclusive:\n        --align-parameter                    Align the parameters\n        --no-align-parameter                 Do not align the parameters\n      This group is all exclusive:\n        --chop-down-parameter                Chop down all parameters\n        --no-chop-down-parameter             Do not chop down all parameters\n      This group is all exclusive:\n        --break-after-functiondef-lp         Break after '(' of function def\n        --no-break-after-functiondef-lp      Do not break after '(' of function def\n      This group is all exclusive:\n        --break-before-functiondef-rp        Break before ')' of function def\n        --no-break-before-functiondef-rp     Do not break before ')' of function def\n      This group is all exclusive:\n        --align-table-field                  Align fields of table\n        --no-align-table-field               Do not align fields of table\n      This group is all exclusive:\n        --break-after-table-lb               Break after '{' of table\n        --no-break-after-table-lb            Do not break after '{' of table\n      This group is all exclusive:\n        --break-before-table-rb              Break before '}' of table\n        --no-break-before-table-rb           Do not break before '}' of table\n      This group is all exclusive:\n        --chop-down-table                    Chop down any table\n        --no-chop-down-table                 Do not chop down any table\n      This group is all exclusive:\n        --chop-down-kv-table                 Chop down table if table contains key\n        --no-chop-down-kv-table              Do not chop down table if table contains key\n      This group is all exclusive:\n        --extra-sep-at-table-end             Add a extra field separator\n        --no-extra-sep-at-table-end          Do not add a extra field separator\n      This group is all exclusive:\n        --break-after-operator               Put break after operators\n        --no-break-after-operator            Do not put break after operators\n      This group is all exclusive:\n        --double-quote-to-single-quote       Transform string literals to use single quote\n        --no-double-quote-to-single-quote    Do not transform string literals to use single quote\n      This group is all exclusive:\n        --single-quote-to-double-quote       Transform string literals to use double quote\n        --no-single-quote-to-double-quote    Do not transform string literals to use double quote\n      \"--\" can be used to terminate flag options and force all following\n      arguments to be treated as positional options\n```\n\nThe program will attempt to automatically use the current directory's `.lua-format` file if no config file is passed in the command line. If none is found, it will try to locate a `.lua-format` file in a parent directory recursively. On Linux it will use `$XDG_CONFIG_HOME/luaformatter/config.yaml` if `.lua-format` does not exist.\nIn case there's no file, it will fallback to the default configuration.\nThe program will give the top priority to the configuration values given in the command-line, then to the configuration files and finally to the hard-coded default values.\n\n### Style configure file\n\nConfiguration parameters not specified fallback to their default values.\n\nSee [this file](https://github.com/Koihik/LuaFormatter/blob/master/docs/Style-Config.md)\n\n### Default configuration\n\n```\ncolumn_limit: 80\nindent_width: 4\nuse_tab: false\ntab_width: 4\ncontinuation_indent_width: 4\nspaces_before_call: 1\nkeep_simple_control_block_one_line: true\nkeep_simple_function_one_line: true\nalign_args: true\nbreak_after_functioncall_lp: false\nbreak_before_functioncall_rp: false\nalign_parameter: true\nchop_down_parameter: false\nbreak_after_functiondef_lp: false\nbreak_before_functiondef_rp: false\nalign_table_field: true\nbreak_after_table_lb: true\nbreak_before_table_rb: true\nchop_down_table: false\nchop_down_kv_table: true\ntable_sep: \",\"\ncolumn_table_limit: column_limit\nextra_sep_at_table_end: false\nbreak_after_operator: true\ndouble_quote_to_single_quote: false\nsingle_quote_to_double_quote: false\n```\n## Limitations\n\n* Do not work when source file contains syntax error\n* Do not support 'Format selection'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fab22593k%2Flua-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fab22593k%2Flua-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fab22593k%2Flua-format/lists"}