{"id":16645612,"url":"https://github.com/boolangery/py-lua-style","last_synced_at":"2025-10-30T12:31:53.817Z","repository":{"id":62577093,"uuid":"115756132","full_name":"boolangery/py-lua-style","owner":"boolangery","description":"A Lua code formatter / indenter written in Python.","archived":false,"fork":false,"pushed_at":"2019-10-04T21:22:02.000Z","size":154,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-02T08:42:07.418Z","etag":null,"topics":["code-formatter","formatter","indenter","lua"],"latest_commit_sha":null,"homepage":"","language":"Python","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/boolangery.png","metadata":{"files":{"readme":"README.rst","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-12-29T21:47:04.000Z","updated_at":"2022-12-06T22:05:14.000Z","dependencies_parsed_at":"2022-11-03T20:14:24.752Z","dependency_job_id":null,"html_url":"https://github.com/boolangery/py-lua-style","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boolangery","download_url":"https://codeload.github.com/boolangery/py-lua-style/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968473,"owners_count":19560586,"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-formatter","formatter","indenter","lua"],"created_at":"2024-10-12T08:24:30.111Z","updated_at":"2025-10-30T12:31:53.437Z","avatar_url":"https://github.com/boolangery.png","language":"Python","readme":"py-lua-style\n===============================================================================\n\n.. image:: https://travis-ci.org/boolangery/py-lua-style.svg?branch=master\n    :target: https://travis-ci.org/boolangery/py-lua-style\n.. image:: https://img.shields.io/pypi/v/luastyle.svg\n    :target: https://pypi.python.org/pypi/luastyle/\n.. image:: https://img.shields.io/pypi/pyversions/luastyle.svg\n    :target: https://pypi.python.org/pypi/luastyle/\n\nA Lua code formatter written in Python.\n\n\nInstallation:\n------------------------------------------------------------------------------\n\nThe package can be installed through `pip`:\n\n.. code-block::\n\n    $ python3.6 -m pip install luastyle\n\nIt will install the shell command 'luastyle'.\n\n\nOptions\n------------------------------------------------------------------------------\n\nThese are the command-line flags:\n\nUsage: luastyle [options] file_or_dir1 file_or_dir2 ...\n\n.. code-block::\n\n  CLI Options:\n    --version                       Show program's version number and exit\n    -h, --help                      Show this help message and exit\n    -i, --in-place                  Write output in-place, replacing input\n    --config=F                      Path to config file\n    --config-generate               Generate a default config file\n    --type=EXT                      File extension to indent (can be repeated) [lua]\n    -d, --debug                     Enable debugging messages\n    -j N, --jobs=N                  Number of parallel jobs in recursive mode\n    -C, --check-bytecode            Check lua bytecode with luac, $LUAC can also be set to\n                                    use a specific compiler\n\n\n  Beautifier Options:\n    -a, --space-around-assign       Ensure one space before and after assign op \"=\"\n    -c S, --indent-char=S           Indentation character [\" \"]\n    -f, --check-field-list          Format field-list (table)\n    -l N, --indent-level=N          Initial indentation level [0]\n    -p, --check-param-list          Format var-list, name-list and expr-list\n    -s N, --indent-size=N           Indentation size [2]\n    -t, --indent-with-tabs          Indent with tabs, overrides -s and -c\n    --close-on-lowest-level         If several closing tokens, indent on lowest token level\n    -F N, --func-cont-level=N       Continuation lines level in function arguments [2]\n    -I N, --if-cont-level=N         If statement continuation line level [2]\n    -M, --check-line-comment-text   Ensure that line comments text is started by at least N char\n    -N N, --com-txt-space-size=N    If --check-line-comment-text is enabled, configure the number of spaces [1]\n    -S, --skip-sem-colon            Skip all semi-colon after statements\n    --break-if                      Break mono-line if statement\n    --break-while                   In while and repeat statement, ensure newline after\n                                    \"do\" or \"repeat\" and before \"end\" or \"until\" keyword\n    --break-all                     Enable --break-if --break-for and --break-while and\n                                    before \"end\" or \"until\" keyword\n    --force-call-spaces             Force spaces before opening parenthesis in function\n                                    call [0]\n    --call-spaces-size=N            If --force-call-spaces is enabled, configure the\n                                    number of spaces\n    --strict                        Enable all features\n\n\nLoading settings from environment or .luastylerc\n------------------------------------------------------------------------------\n\nIn addition to CLI arguments, you may pass a config file via:\n\n- the LUASTYLE_CONF environment variables pointing to a config file\n- a .luastylerc file located in your user directory\n\n\nOptions examples\n------------------------------------------------------------------------------\n\n\nContinuation lines level in function arguments (-F)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block::\n\n    -F N, --func-cont-level=N   Continuation lines level in function arguments [2]\n\nGiven:\n\n.. code-block:: lua\n\n    local function process(param_1, param_2, param_3,\n      param_4, param_5, param_6)\n      return do_something()\n    end\n\n.. code-block:: console\n\n    $ luastyle -c \".\" -F 2 source.lua\n\n.. code-block:: lua\n\n    local function process(param_1, param_2, param_3,\n    ....param_4, param_5, param_6)\n    ..return do_something()\n    end\n\n\nComments formatting options (-M, -N)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAvailable options are:\n\n.. code-block::\n\n    -M, --check-line-comment-text Ensure that line comments text is started by at least N char\n    -N N, --com-txt-space-size=N  If --check-line-comment-text is enabled, configure the number of spaces [1]\n\nGiven:\n\n.. code-block:: lua\n\n    --Lorem ipsum dolor sit amet\n    local foo --In sodales elit id orci mollis varius\n\n\n.. code-block:: console\n\n    $ luastyle -M -N 1 source.lua\n\n\n.. code-block:: lua\n\n    -- Lorem ipsum dolor sit amet\n    local foo -- In sodales elit id orci mollis varius\n\n\nBreak If statement option (--break-if)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGiven:\n\n.. code-block:: lua\n\n    if condition then return success() else return failure() end\n\n\n.. code-block:: console\n\n    $ luastyle --break-if source.lua\n\n\n.. code-block:: lua\n\n    if condition then\n      return success()\n    else\n      return failure()\n    end\n\n\nFormat table field-list (-f)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis option ensure that:\n  * field separator in table (',' or ';') are trailing\n  * comma is preceded by one space and followed by two spaces\n\nThe keyword '@luastyle.disable' placed in a comment just after the opening brace\nwill disable this feature in the concerned table.\n\nGiven:\n\n.. code-block:: lua\n\n    local days = {\n      monday = 1,\n      tuesday = 2\n    , wednesday = 3\n    }\n\n    local n = {1  , 2,3}\n\n    local t = {\n      -- @luastyle.disable\n      1,    2,    4,\n      8,    16,   32\n    }\n\n\n.. code-block:: console\n\n    $ luastyle -f source.lua\n\n\n.. code-block:: lua\n\n    local days = {\n      monday = 1,\n      tuesday = 2,\n      wednesday = 3\n    }\n\n    local n = {1, 2, 3}\n\n    local t = {\n      -- @luastyle.disable\n      1,    2,    4,\n      8,    16,   32\n    }\n\n\n\nIndent closing token (--close-on-lowest-level )\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGiven:\n\n.. code-block:: lua\n\n    describe('must indent', function()\n      done()\n    end)\n\n\n.. code-block:: console\n\n    $ luastyle --close-on-lowest-level source.lua\n\n\n.. code-block:: lua\n\n    describe('must indent', function()\n        done()\n      end)\n\n\n.. code-block:: console\n\n    $ luastyle source.lua\n\n\n.. code-block:: lua\n\n    describe('must indent', function()\n        done()\n    end)\n\nFunction call formatting options (--force-call-spaces, --call-spaces-size)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGiven:\n\n.. code-block:: lua\n\n    build (foo)\n\n\n.. code-block:: console\n\n    $ luastyle --force-call-spaces source.lua\n\n\n.. code-block:: lua\n\n    build(foo)\n\n.. code-block:: console\n\n    $ luastyle --force-call-spaces --call-spaces-size=1 source.lua\n\n\n.. code-block:: lua\n\n    build (foo)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolangery%2Fpy-lua-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboolangery%2Fpy-lua-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolangery%2Fpy-lua-style/lists"}