Pylint plugin for PyCharm

I'm trying to develop a proof-of-concept Pylint plugin for PyCharm (see https://github.com/genericmoniker/pylint-plugin). I'd like to have on-the-fly highlighting of issues while editing code just like PyCharm's own built-in inspections.

My strategy has been to start with the PEP 8 plugin and try to adapt it for Pylint. My very rough initial efforts are working for manually invoked inspections through the "Code" > "Inspect Code..." menu, but I don't get any inline highlighting while editing.  My PylintInspection.buildVisitor method gets called at what appears to be the right time, but I get lost in the IDE code knowing what should be done differently such that my PylintExternalAnnotator.doAnnotate gets called (assuming it is even correct to expect that).

Can anyone suggest some good documentation for this, or provide other guidance? Or suggest an entirely different approach?

Why I'm trying this...

Basically I want a workflow with a CI server that fails builds because of static analysis problems, combined with on-the-fly highlighting of those problems while editing within PyCharm. Unless I'm mistaken, there's not a way to run PyCharm's inspections through a CLI such that it could integrate with a CI server, so that suggests trying to integrate something with a CLI into PyCharm.

While I know that I could run Pylint as an external tool, that doesn't provide the on-the-fly feedback. Furthermore, if I legitimately decide to suppress an inspection, I would have to do it both using PyCharm's syntax as well as Pylint's. The first to have a "clean" editor session and the second to not fail the CI build. It gets kind of ugly. If the Pylint plugin idea worked, I guess I would turn off PyCharm's built-in inspections.

Thanks

 

4
1 comment

Please sign in to leave a comment.