-
Notifications
You must be signed in to change notification settings - Fork 11
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
Provide stylua.toml with explicit formatting conventions #43
Comments
I've never used stylua. I think the only formatting that happens is provided by the Lua language server's defaults. Could look into providing that file when I have time to look into more details about it. 😄 [EDIT] It seems like sylua uses Roblox's style guide per JohnnyMorganz/StyLua#693. Not sure if there's a template stylua file that matches the EmmyLuaCodeStyle format. [EDIT2] Alternatively, we just switch the style to use stylua. I don't have a preference on style at the moment, so happy to have a PR that reformats all Lua files to a a stylua if that's the best formatter these days. Would mean I'd need to figure out how to turn off the language server formatter. |
I just did some research. I think, the best way is to provide a |
There is also a Github Action and pre-commit-hook for stylua. What setup would you prefer? Adding a pre-commit hook or just relying that a developer would use either stylua or lua-language-server for formatting? We could add the stylua GH action to the pipeline just to check. That's what nvim-orgmode does. We could also reformat and autocommit in the CI pipeline. Personally I'm a bit undecided, but I think I would prefer the check and the pre-commit hook. We could also provide both, a stylua.toml and an .editorconfig (like nvim-orgmode). |
Personally, I like having there be a failure if your PR doesn't match expected formatting, rather than doing the formatting for you. So I'd rely on someone to use stylua or the lua language server to do the formatting, or just hand-format based on the error messages from a github action. Also, if nvim-orgmode has a stylua, we could just follow that one and do a big reformat of the plugin to follow it. I really don't mind which way we go 😄 |
I created a PR: #44. Please give me a sign, that you commited/merged all your intermediate code changes, than I will do the reformatting and the branch can be merged. I just want to avoid big merge conflicts with ongoing changes on your side (I just know the pain 😅). |
Now active commits or branches on my side. You're good to go. |
When I tried to make some changes to the code, I realized, that my formatter settings are not compatible with the projects one, it reformats all the code. To make it easy to contribute, it would be very beneficial to provide these settings as a stylua.toml.
The text was updated successfully, but these errors were encountered: