{"id":15722650,"url":"https://github.com/indiesoftby/defold-editor-script-lua-format","last_synced_at":"2025-05-13T03:45:34.546Z","repository":{"id":194657435,"uuid":"233088528","full_name":"indiesoftby/defold-editor-script-lua-format","owner":"indiesoftby","description":"Editor script that reformats your Lua source code.","archived":false,"fork":false,"pushed_at":"2020-11-18T12:56:15.000Z","size":3870,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T06:18:55.403Z","etag":null,"topics":["defold","defold-editor-script","defold-game-engine"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/indiesoftby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-01-10T16:38:12.000Z","updated_at":"2024-08-06T18:30:33.000Z","dependencies_parsed_at":"2023-09-14T13:55:03.674Z","dependency_job_id":null,"html_url":"https://github.com/indiesoftby/defold-editor-script-lua-format","commit_stats":null,"previous_names":["indiesoftby/defold-editor-script-lua-format"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-editor-script-lua-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-editor-script-lua-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-editor-script-lua-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-editor-script-lua-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indiesoftby","download_url":"https://codeload.github.com/indiesoftby/defold-editor-script-lua-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870822,"owners_count":21976610,"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":["defold","defold-editor-script","defold-game-engine"],"created_at":"2024-10-03T22:08:46.298Z","updated_at":"2025-05-13T03:45:34.537Z","avatar_url":"https://github.com/indiesoftby.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"# Lua Code Formatter for Defold IDE\n\n⚠ The project is archived, no longer maintained. Use [https://github.com/JohnnyMorganz/StyLua](https://github.com/JohnnyMorganz/StyLua) or similar tools. ⚠ \n\n[![Build Status](https://travis-ci.com/indiesoftby/defold-editor-script-lua-format.svg?branch=build-lua-format)](https://travis-ci.com/indiesoftby/defold-editor-script-lua-format) [![Build status](https://ci.appveyor.com/api/projects/status/bbo48o35tfhfj5t9/branch/build-lua-format?svg=true)](https://ci.appveyor.com/project/aglitchman/defold-editor-script-lua-format/branch/build-lua-format)\n\n[Defold IDE](https://www.defold.com) editor script that reformats your Lua source code. Uses [LuaFormatter](https://github.com/Koihik/LuaFormatter).\n\n## Installation\n\n~~You can use this editor script in your own project by adding it as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your `game.project` file and in the dependencies field under project add:~~\n\n~~[https://github.com/indiesoftby/defold-editor-script-lua-format/archive/master.zip](https://github.com/indiesoftby/defold-editor-script-lua-format/archive/master.zip)~~\n\n**The script will work if you simply copy paste the script folder into your project.**\n\nThis script is accessible through the context menu in the asset view, it's context sensitive and will only show when you are clicking on the relevant file - `.lua`, `.script`, `.editor_script`, `.gui_script` or `.render_script`.\n\n![](example.png)\n\n## Git pre-commit hook\n\nGit has a way of firing off custom scripts that perform certain operations. These scripts are referred to as *hooks*. The hooks are all stored in the `hooks` subdirectory of the Git directory that's `.git/hooks`.\n\n*Note:* `.git/hooks` directory isn't cloned with the rest of your project, nor is it under version control.\n\n`editor-script-lua-format/git-hooks/pre-commit` contains a sample hook that applies a coding style with `lua-format` to staged files. It will help you format your code before you commit them. So when you try to commit your code, given script will run and format staged files.\n\nCopy contents of the sample pre-commit hook to the custom pre-commit:\n\n```bash\n$ cp ./editor-script-lua-format/git-hooks/pre-commit ./git/hooks/pre-commit\n```\n\nMake the pre-commit script executable (only on Linux and macOS):\n\n```bash\n$ chmod +x ./git/hooks/pre-commit\n```\n\n## Style configuration\n\nLua formatter will attempt to automatically use the root directory's `.lua-format` file. In case there's no file, it will fallback to the default configuration.\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: \",\"\nextra_sep_at_table_end: false\nbreak_after_operator: true\ndouble_quote_to_single_quote: false\nsingle_quote_to_double_quote: false\n```\n\n## Limitations\n\n- Does not work when source file contains syntax error\n\n## License\n\nApache 2 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findiesoftby%2Fdefold-editor-script-lua-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findiesoftby%2Fdefold-editor-script-lua-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findiesoftby%2Fdefold-editor-script-lua-format/lists"}