Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format the codebase consistently #331

Open
Ruin0x11 opened this issue Apr 30, 2021 · 0 comments
Open

Format the codebase consistently #331

Ruin0x11 opened this issue Apr 30, 2021 · 0 comments

Comments

@Ruin0x11
Copy link
Owner

Ruin0x11 commented Apr 30, 2021

Right now everything is formatted ad-hoc by lua-mode at 3-column indentation. But until recently I didn't know of any Lua code formatter that works consistently enough.

Thankfully someone has finally done all the boring and painful work of writing a Lua code formatter that actually works, called StyLua.

For most of the codebase, the actual changes after formatting are rather minimal. There are only two things that I'd configure for it:

  1. Ability to preserve table constructor call syntax for single-argument function calls (for data:add {}).
  2. Automatically hanging method chains when the first expression in the chain is a string constant wrapped in parentheses (for use inside locale/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant