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
Question about Configuration Options #48
Comments
Hey there, thanks for the interest in StyLua! I feel as though, in regards to configuration options, I do not wish to add too many. The project was originally inspired by Prettier, and I feel as though their range of options (where applicable to Lua) are a reasonable set personally (but they do regret some of them, as explained here) That being said, I am happy to facilitate discussion around specific formatting points, and if there's a style which is common in a lot of places, I'm happy to think about supporting it. This might lead on to add a configuration if the general consensus agrees (see #28 - there was a further discussion off GitHub too), but I'll be hesitant at first. Do you mind explaining specifically the configuration you use from LuaFormatter that you would like to see in StyLua? |
Oh, and a point to mention, I follow the Roblox Lua Style Guide when implementing the style choices, so it would be unlikely that anything going against that would be supported. But again, I'm happy for discussion. |
Quote Style - yeah, there was some discussion here, and I'll probably add it in (feel free to react with your support on #28 just so I have a better indication) Line length - this is actually all over the place inside of the codebase right now, as there isn't a single best way to do this with the current way everything has set up (see, #5). Its all based on best-guess heuristics at the moment. I know Prettier has a configuration option here, and I think I can agree on this case to add an option too. From your screenshots, was this the ouput of StyLua or LuaFormatter? In the first screenshot, you're right in saying that's line length related. The second one though, that doesn't look like StyLua output - are you saying the addition is how you would've liked it to be laid out? |
that's Stylua output from a codebase that did not use any auto formatter before: https://github.com/WeakAuras/WeakAuras2/blob/main/WeakAuras/WeakAuras.lua |
Hm I just tested that now, and that is not what I was expecting (I thought StyLua would actually just stick it on one big line, which in itself isn't great either). For the second screenshot, I would agree that what you had originally would actually be the best style here - feel free to open up a separate issue for this, and I can check it out soon. |
Hey there! I know you said this is very opinionated but I was wondering which configuration options you are going to/willing to add in the future. I'm very interested in using this as a replacement for LuaFormatter which does allow the following https://github.com/Koihik/LuaFormatter#default-configuration
The text was updated successfully, but these errors were encountered: