-
Notifications
You must be signed in to change notification settings - Fork 69
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
Unexpected token 'goto' using stylua from pre-commit #867
Comments
I think this is actually the other way round. In this case, the stylua cargo hook is built with the default features, which is just lua51. We need to somehow add a |
After fiddling for a while with pre-commit looks like there's no way to do this without changing the default features 😞 I'll open an issue in pre-commit for passing features to rust hooks. If I find a workaround I'll post it here. |
Any updates on the mentioned issue/pr associated with it? I have a codebase with a workflow using stylua and every commit is saying format fails with the goto statement, it's becoming quite a bother |
Just ran into this same issue, using stylua |
Unfortunately not much I can do on my side, since pre-commit needs to give options to enable features I think. Your alternative right now is to use stylua-github (has all features, but you might hit #407) or stylua-system. That being said, I am working on #854 that will move syntax selection from compile time to run time, which will solve this problem |
Gotchya. Installing with |
I've readed the problem with stylua prebuilt binaries in #240 and #407 , however AFAIK this error isn't expected in the stylua compiled by pre-commit using the repo's file Cargo.toml.
My relevant pre-commit config:
But still it doesn't work:
Is this error expected?
If it is, is there any workaround apart from using the stylua-system hook?
The text was updated successfully, but these errors were encountered: