-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Integrate with existing tools #10
Comments
Are you already working on an Atom plugin? If not, I could give it a try. |
I haven't started working on it, so the help would be much appreciated. Thanks! EDIT: Also, let me know if there's anything I can do to help -- I know Vale's documentation is poor at the moment. |
Thanks. I plan to have a first version ready at the weekend. |
No, this isn't currently supported. I'm not against adding this functionality, but I haven't decided on the best way to handle it yet. Since Vale tries to be smart about syntax (e.g., ignoring code blocks), it'd either have to treat all text from |
Ok. Then it's linting on save for now, but I'm happy to make it on-the-fly linting once you implement this. |
Thanks—it looks great! I'll let you know once I've implemented support for on-the-fly linting (it should be reasonably soon). As far as ownership goes, I'm fine with you keeping it. It's up to you, though. |
Ok, then I'll keep ownership for now. |
I've implemented support input for stdin: # Will be treated as plain text
$ vale 'This is some text to lint'
...
# Will be treated as Markdown
$ vale --ext='.md' 'This is some text to lint'
...
# Will be treated as plain text
$ echo 'this is more text' | vale
... should all work now. I also have this working on a branch of the Sublime Text plugin (https://github.com/ValeLint/SubVale/blob/feat/buf/Vale.py#L53). |
I think vale should give other exit code then zero when there are some errors or warnings.
Some other tools relay on non-zero (1) exit code to process the output further. |
@chew-z: Vale should exit with (1) on errors already (for example, I'm using Vale to lint its own documentation on Travis CI and the build will fail on errors). I think this is reasonable default behavior as you'll likely want to ignore many warnings and you can always change the rule's level if not: [*]
vale.Editorializing = error That said, I'm open to making this more configurable. Would you want a setting to control which levels result in a non-zero exit code? |
Yes, I think it would be useful to have more control over non-zero exit. What I have been trying to do in a very lazy way was integrating vale with vim through ale plugin. I have simply copied plugin for proselint which comes to calling external command on a copy of current file. This should be simple enough but I had no luck so far. Called from internal shell vale returns nice warrnings just like proselint
but proselint is also returning exit 1 and this is what triggers ale into action, I think. This is common convention in vim that it is passing quietly when exit code is zero. I will digg into that more tomorrow. |
After glancing at one of the implementations for $ vale --output=line /test/double.md
/test/double.md:2:13:vale.Repetition:'be' is repeated! |
There was a small, unrelated bug in ale which just had been fixed. So now VIM+ale+vale is beautifully working for me with very minimal plugin in .../ale/ale_linters/markdown/vale.vim:
btw: what is option --ext='.md' good for? |
Vale needs to know the format of a file so it can properly lint it (e.g., skip code blocks, etc.). This is normally done by inspecting the file extension, but there's no extension when input is given via stdin. So, you can optionally specify one with |
@chew-z With |
So my pull request has been accepted and glue for vale is now part of ale. So it could be said that now vale is integrated also with VIM. |
Thanks! I've updated the README. |
FYI, I wrote and published a VSCode extension. I'm sorry; I didn't realise you were already working on one, and I'm happy to deprecate my extension when the official one is ready. |
@lunaryorn: Oh, that's okay! Mine is in pretty rough shape anyway, so I think I'll just defer to your work. |
@jdkato Thanks 😊 |
@jdkato Can we reopen this, or track some of the other integration points elsewhere? I am working on some browser plugin ideas… |
One really useful step that I'm a bit stuck on is figuring out how to run vale on a remote host. I'm not too familiar with go to know the best and most cost-effective way of doing this though. |
@ChrisChinchilla: Sure, I've created a new issue (#97) where we can discuss browser addons/plugins. |
Editors + CLI tools
Other
The following would be nice to have, but will probably need to access Vale through an API of some sort (see languagetool-msword10-addin, for example).
The text was updated successfully, but these errors were encountered: