Checker for vim scripts #725
Comments
Oh yes, many people would like to have some kind of syntax checker / formatter / pretty printer for VimL, even without syntastic. Sadly, and to the best of my knowledge, nobody has written such a tool yet. Looking at Vim sources, I'd say writing such a tool would be highly nontrivial. |
I just finished writing a Vim Linting utility if you're interested. :) |
Excellent! But, why not make it a standalone distribution? Syntastic internals may change, so why keep your vimlint tied to it. |
@lcd047 My reasoning is that having to install vimlint using an external utility such as |
@dbakker Well, vimlint has two unrelated components: a python script, and a syntax checker for syntastic. The syntax checker belongs in syntastic, but the python script is just a normal, autonomous script, it doesn't need syntastic, vundle, or Vim to run. Making it a first-class, standalone script would also simplify the corresponding syntastic checker. :) |
There is a vim syntax checker here, in case anyone has the motivation to try it out: |
@bukzor Added in 87e237a. It's actually a frontend to Yukihiro Nakadaira's vimlparser, which does most of the heavy lifting (you need to have both installed). Vimlparser also has Python and JavaScript components, but they are not used by syntastic. You don't need to have Python installed to run the checker, which is nice. On a side note: there is a naming conflict with the checker mentioned above written by @dbakker. Sorry about that, the name vimlint is more appropriate for the new checker, since the project by @dbakker is actually called vim-lint. A possible solution would be to rename the checker by @dbakker as vim_lint. |
@lcd047 Nice! Kudos! For maximum meta-ness I used syntastic+vimlint to lint the syntastic vimlint file.
I've no clue exactly how spurious that warning is, but it does seem correct. Is this issue closed then? |
Well, I don't think it was ever meant as a bug report. :) VimL is a pain in the rear of a language, and it's good to have a high quality checker for it. And vimlparser is an excellent one, it actually produces ASTs, and there are utilities that can compile the code to Python, and to JavaScript. Now if we could also have a style checker, to look for things like indentation and consistent spelling of keywords, it would be even nicer. :) |
I was excited to see there's a linter for vimscript, but I can't for the life of me figure out how to use it. https://github.com/scrooloose/syntastic/blob/ce89396808/syntax_checkers/vim/vimlint.vim contains no relevant comments. Clearly it depends on a plugin that defines autoload/vimlparser.vim and autoload/vimlint.vim, but there are no hints about where to find said plugin, and there are quite a few projects on github called "vimlint". |
Yeah, eventually found that. Still think the file should have at least a brief comment and maybe a link or two, considering most checkers have something, it's a rare checker that requires two separate plugins, and one of them has a "TODO: write something" instead of a README. |
@dbarnett: Is there any particular reason why you expect to find user-level docs in the source files rather than where the docs are normally supposed to be? For syntastic, the docs are the manual, and the wiki. |
Yeah, a few reasons:
Now I've bootstrapped myself, so whatever. But the angle I came at it from I ended up trying one after another "vimlint" plugin from github that claimed to integrate with syntastic, and not being able to get any of them to work. |
Ok, they no longer do. The relevant comments have been moved to the wiki more than an year ago; this patch just removes them from the sources. Commit 650c736. |
Syntastic ironically has no verification for vim scripts/vim syntax.
It's beautiful when a tool is able to self-apply.
I was able to see if a plugin is valid by issuing:
vim -e --noplugin -u /dev/null -c 'source plugin/myplugin.vim | quit'
Unfortunatelly, that only produces an error code, no output indicating the problem.
The text was updated successfully, but these errors were encountered: