Open dhruvdcoder opened 5 years ago
I am too interested :). Is there a documentation/example for integrating a new linter?
The easiest way is to look at an existing linter for examples, and read :help ale#linter#Define()
for explaining what all of the options do. :help ale-dev
will take you to some documentation for ALE development.
I have just seen this tool and it is really really useful. However, with the current master branch, this script is no longer working. Are you still using it? Do you have any updated version?
The script still works with Darglint's default message pattern {path}:{obj}:{line}: {msg_id}: {msg}
. The key line is this regex. If you have changed the default message pattern for Darglint as shown here, then you will need to change the regex accordingly.
Hope this helps.
Thank you so much! I did not expect such quick response. Good to know it. However, in your .vim file, there is a function ale#path#CdString
that is no longer used in the current version. It seems to be a function that was used in a few linters in order to execute a cd command in case it was necessary. I could check that in the current release, this function was removed and changed in all the files that were using it (commit: 9fe7b1fe6a23fb55e6d782293585d58193123f59). Due to this, I get an error as it cannot find the reference to this function. Are you using it with the last release/version? Do you know if this command is necessary before the darglint command is used?
Edit: For those who were wondering, here is the fix of this file for the current master version:
ale_linters#python#darglint#GetCwd
\ 'cwd': function('ale_linters#python#darglint#GetCwd'),
at the endreturn ale#Escape(l:executable) . l:exec_args \ . ale#Var(a:buffer, 'python_darglint_options') \ . ' %s'
Then you can use your arguments in the vimrc file as let g:ale_python_darglint_options = ' --docstring-style sphinx'
Name: darglint URL: https://github.com/terrencepreilly/darglint
It is useful if you want to autogenerate documentation using sphinx autodoc (it supports google style docstrings).
I got a simple version working using the following script. dhruvdcoder/darglint.vim
I am no vim expert and hence a bit apprehensive about add this through a pull request myself.