nvim-lint
nvim-lint copied to clipboard
Vale linter setup exits with code 2
I'm using Neovim v0.9.5 with nvim.lazy and have installed the nvim-lint plugin. I have installed the "Vale" linter with Mason. I have configured Vale in in the ~/.local/share/nvim/mason/packages/vale/
directory and verified I can run Vale there on the command line.
I have this config file for nvim-lint:
return {
"mfussenegger/nvim-lint",
event = {
"BufReadPre",
"BufNewFile",
"BufWritePost",
},
config = function ()
local lint = require("lint")
lint.linters_by_ft = {
text = { "vale", },
markdown = { "vale", },
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
end,
})
end,
}
I open a "test.md" file with some text in Neovim, when I save the buffer I get:
Linter command `vale` exited with code: 2
I get the same when I run this command in Neovim with the "test.md" file in the buffer:
:lua require("lint").try_lint()
I've looked in the log files in ~/.local/state/nvim/
but can see nothing from nvim-lint or Vale there
Any help in solving this would be appreciated.
I ran into the same issue. Did you manage to resolve it?
I'm encountering a similar issue. Executing Vale via the command line for a specific file yields the following output:
E100 [.vale.ini not found] Runtime error
no config file found
Execution stopped with code 1.
Placing a vale.ini configuration file at the root of the project appears to be a potential fix. However, this approach doesn't seem particularly optimal.
You have to sync the vale package for the first usage:
- You can create a ~/.config/vale/.vale.ini file
- Then use full path to sync the mason package with the global config. ~/.local/share/nvim/mason/packages/vale/vale --config=$HOME/.config/vale/.vale.ini sync
This is my .vale.ini: StylesPath = . MinAlertLevel = suggestion Packages = RedHat, alex [*] BasedOnStyles = Vale, RedHat, alex
Use styles=. so it syncs your sytles to where the global config is store. I hate clutter in my home folder
EDIT: source: https://docs.rockylinux.org/books/nvchad/vale_nvchad/#__tabbed_1_2
@hriva thanks for the link, fixed all my errors
You have to sync the vale package for the first usage:
- You can create a ~/.config/vale/.vale.ini file
- Then use full path to sync the mason package with the global config. ~/.local/share/nvim/mason/packages/vale/vale --config=$HOME/.config/vale/.vale.ini sync
This is my .vale.ini: StylesPath = . MinAlertLevel = suggestion Packages = RedHat, alex [*] BasedOnStyles = Vale, RedHat, alex
Use styles=. so it syncs your sytles to where the global config is store. I hate clutter in my home folder
EDIT: source: https://docs.rockylinux.org/books/nvchad/vale_nvchad/#__tabbed_1_2
if you are in a macos the path is not ~/.config but $HOME/Library/Application Support/vale/.vale.ini as specied there