Closed BennyThadikaran closed 1 month ago
:checkhealth guard
If neovim can't find the executables, there's not much that we can do!
I executed this from a python file after this error: stylua not executable
guard: require("guard.health").check()
Executable check ~
Thank you for helping with this.
That's not very helpful, are you on windows?
Linux Mint 21.3. I am using an appimage for Neovim.
which stylua
stylua --version
:= vim.fn.executable("stylua")
stylua 0.20.0
black, 24.4.2 (compiled: yes) Python (CPython) 3.10.12
I'm dont need stylua, mostly code in Python. I got this temporary solution as workaround.
vim.api.nvim_create_augroup("FormatOnSave", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
group = "FormatOnSave",
pattern = "*.py",
callback = function()
local black_path = '/home/benny/.local/share/nvim/mason/bin/black'
vim.cmd('!' .. black_path .. ' -q -l 80 ' .. vim.fn.expand('%'))
vim.cmd('edit')
end,
})
Right, so what's your problem now? I'm getting rather confused.
Like i mentioned before, none of the formatters are working anymore (Prettier, Black, Stylua). No formatting on save, no :GuardFmt
Everything was working before the latest update. It fine, if you're unable to help with the information provided.
Thanks for your time :+1: I'll figure something over the weekend.
@BennyThadikaran does this path /home/benny/.local/share/nvim/mason/bin
in your PATH env ?
Well, the errors told you that they are not executable. But your env seemed to have changed between replies, which confuses me.
check :echo executable('where balck is')
I suggest install bacl from your system package management and remove which install by mason and try again.
@BennyThadikaran does this path
/home/benny/.local/share/nvim/mason/bin
in your PATH env ?
No its not.
check
:echo executable('where balck is')
I suggest install bacl from your system package management and remove which install by mason and try again.
That makes sense. I executed :echo executable('where black is')
and it returned 0. I will install and get back.
Thanks
PS: I executed ./stylua --version
from the mason/bin folder, since its not in my $PATH. Sorry if that got you confused.
I get the below error in Neovim when opening a Lua file. The problem started yesterday after I updated to latest guard.nvim. I then updated Neovim to latest and updated the formatters via Mason and rechecked the formatter config. I also tried reinstalling the formatters and guard.nvim.
Switched to autopep8 but nothing seems to work. Even :GuardFmt
Disabling stylua stops the error in Lua files but i get a slightly different error with same stack trace when loading Python or JSON files
NVIM v0.10.1 Build type: Release LuaJIT 2.1.1713484068
guard.nvim config
Some command outputs i thought might help
:=require("guard.filetype").json Running from within JSON file, similar output for python file.