Closed leesoh closed 9 months ago
Just tried it and for me it works fine. Are you sure you're not having some hiccup with the StylesPath
in the vale.ini
?
I didn't think so because the only thing I was changing between attempts was whether the config was in a hidden folder or not. I'll take another look today.
Here's my vale.ini
:
StylesPath = /home/leesoh/.config/vale/styles
MinAlertLevel = suggestion
Packages = Microsoft
[*]
BasedOnStyles = Vale, Microsoft
The same configuration file was used by both the plugin and the CLI tool, but I only received errors using the plugin.
Trying it for myself, I did have some errors with the example given since markdownlint
isn't enabled/installed, but that's it.
My guess is that the configuration may not be getting stored properly, as :lua require("lint").try_lint()
shouldn't error as though vale sets an exit code on completion normally, it should be getting passed the --no-exit
flag...
Could also add support for a config key to the linter configuration
Agreed. I couldn't figure out why there'd be an exit code either. And it's really strange that moving the configuration to a non-hidden directory solves the issue.
I just came back to this on a fresh system. I was wrong initially: I don't believe the --config
argument is parsed at all. If the config file is in a location Vale expects, it will be loaded. Otherwise, it will exit with the above error.
I just came back to this on a fresh system. I was wrong initially: I don't believe the
--config
argument is parsed at all. If the config file is in a location Vale expects, it will be loaded. Otherwise, it will exit with the above error.
So this is a vale issue?
I don't think so. When I run vale test.md --config nonexistent.ini
, I get an error that the path cannot be found. When I point to a valid vale config in /tmp
, it runs.
I have the same issue on MacOS 13.4.1: if I place my .vale.ini in ~/.config/, it is not picked up by nvim-lint (exit code 2), while if I move it directly to the home directory, it works as expected.
I was experiencing the exact same problem (also MacOS 13.4.1), but actually at some point it stopped, and now has a sensible behavior...
For sure, I should have been doing something wrong before, but now all the combinations are working as expecting. I.e. I'm using:
local vale = require("lint.linters.vale")
vale.args = {
"--no-exit",
"--output",
"JSON",
"--ext",
get_cur_file_extension,
"--config",
os.getenv("XDG_CONFIG_HOME") .. "/vale/vale.ini",
}
and if I replace os.getenv ...
line by "/Users/myuser/.config/vale/vale.ini"
is working as well, while omitting the last letter, e.g., gives back the error code 2.
By working I mean that the error is not generated any longer, I haven't properly tested the linter itself.
EDIT: I also tested some lints, I confirm it's properly working
Hi there! First off, thanks for all the work you've put into this plugin. I really like the approach!
I'm running into an issue with Vale. I store my Vale configuration in
/home/leesoh/.config/vale/vale.ini
. Runningvale --config /home/leesoh/.config/vale/vale.ini
works as expected.I've configured the Vale linter like so:
I get no errors when saving a markdown file, but I also get no linting. When I run
:lua require("lint").try_lint()
, I get the following:Linter command
valeexited with code: 2
. If I move myvale.ini
to /home/leesoh/vale.iniand update my configuration, everything works as expected. Moving it to
/home/leesoh/.hidden/vale.ini` breaks it again.I took a quick look at the source, but couldn't find a reason for this so I'm hoping you can help. Thanks!!