Added formatting requirements using with StyLua#36
Added formatting requirements using with StyLua#36rcampos2029 wants to merge 3 commits intoaaronik:mainfrom
Conversation
| sudo apt-get install lua-check -y --no-install-recommends | ||
| make check | ||
|
|
||
| - name: Check formatting |
There was a problem hiding this comment.
Oh I meant to separate the "Install Stylua" stage from the "Check formatting" stage, but I accidently left the make check-fmt call in the first block. Do you want these two put together? I thought they may be better separated so that it would be easier to debug if it is the stylua installation that fails.
|
The tests are still passing on the main branch, so I don't think there's some weird treesitter difference. I think these changes actually broke something |
|
Ack. I'll take a look later today |
|
Ah I found the issue: stylua updated the lua files in the fixture/ directory as well, which caused the lua-specific checks to fail. I get a bunch of errors with the markdown spec when I run the tests locally, even though I do have the markdown parser installed. How does the CI install the parsers needed by the tests? |
|
Oo I do not know what that Hey listen I'm going through these stylua changes and am feeling uncomfortable with the changes. TBH I don't think it's cleaning up the code at all, I think the code is going from quite clean and expressive, to often cases much less so. Some of the ternaries that are on one line are on one line for a reason - it reads better to me. The indentation of the comments is to help it read better. The multiline if statements help it read better - a lot of times this stylua is turning clean one lined things into multiple lines, but then turning clean multiple line things into very hard to read one line things. I like the idea of a style guide, but what this is doing to my code here, not really comfortable with it. I know I asked for you to add this to this repository, and I was excited about it, but then when I saw what it was doing... I got uncomfortable with it. So I think I need to just nix this from this repo. Really sorry to lead you on on this, and I really, really appreciate you taking the time to add it here, especially since it required some trouble shooting. Thank you @rcampos2029, I appreciate your contribution! |
No worries! Thanks for showing me this plugin. I've only been using it a couple of days and it's already made navigating through code a lot easier. |
stylua, with the formatting defined instylua.tomlcheck-fmtwhich checks the formatting of lua files andfmtwhich formats the fileThis pr is similar to that filed in GPTModels
Running CI locally fails with the following error:
This appears to be due to using a newer version of treesitter. I'll dig into this more, but the githiub CI may pass without additional changes needed.