maralla / validator.vim

Check syntax on the fly asynchronously.
MIT License
213 stars 14 forks source link

Attempt to support pylint #56

Open kbenzie opened 7 years ago

kbenzie commented 7 years ago

Hi, I made a quick attempt to add support for pylint as an additional python linter and found an issue with how validator.vim works and how pylint expects to be executed.

The problem boils down to the use of the temporary file which is passed to the linter, pylint expects to be executed with the path to a python package, or a module within a package hierarchy. This makes pylint fall flat on on its face.

I understand it is necessary to use a temporary file for on-the-fly checking, so my first thought was to send the file content to pylint on stdin but this sadly is not a supported mechanism.

My second thought was to tell pylint the working directory it should use when linting the python module, yet again my hopes were dashed.

The leaves one possible option that I can see, other than abandoning supporting pylint, which is to use a temporary file in the same directory as the file being edited instead of in /var. This doesn't seem like a nice solution to me but I've become quite reliant on the diagnostics of pylint despite its annoyances but have grown tired of syntastic's lack of support for vim jobs.

Since the temporary file is created based on the name returned from tempname() it seems like this approach might be a bogus.

A penny for your thoughts.