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:
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.20.0
hooks:
- id: stylua
But still it doesn't work:
❯ pre-commit run --files nvim/.config/nvim/lua/modules/neotest/consumers/fidget.lua
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check Yaml...........................................(no files to check)Skipped
Check JSON...........................................(no files to check)Skipped
Check for added large files..............................................Passed
Git Secrets..............................................................Passed
StyLua (cargo)...........................................................Failed
- hook id: stylua
- exit code: 2
error: could not format file nvim/.config/nvim/lua/modules/neotest/consumers/fidget.lua: error parsing: error occurred while creating ast: unexpected token `goto`. (starting from line 70, character 13 and ending on line 70, character 17)
additional information: expected 'end'
Is this error expected?
If it is, is there any workaround apart from using the stylua-system hook?
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?