2

I would like to use PyLint as an automatic code inspection in PyCharm, as in VSCode. (Marking with errors with red underscores and the like)

I found a way to run pylint in PyCharm as an external tool, but that was not exactly what I was looking for. (I want it to continuously run while I develop)

Is that supported in PyCharm?

yuvalm2
  • 866
  • 2
  • 10
  • 27

1 Answers1

2

pylint is not fast enough to run continuously, it's possible to do it using file watchers, but you're going to make your IDE laggy and it's going to be a bad experience overall.

Consider that checking code duplication means that the code from your file will be compared to all the code from all the other files in your repository on each keystroke (!). This is a single check and pylint is doing a lot more than this one.

You should run pylint using the pycharm-pylint plugin, as a pre-commit hook, or even as a continuous integration job.

Pierre.Sassoulas
  • 3,733
  • 3
  • 33
  • 48
  • Do you know how that's implemented in VSCode, which appears to do that? – yuvalm2 Apr 02 '23 at 14:35
  • It's possible to deactivate some checks (like duplicate code for example) to make pylint faster, but it requires some configuration. There's also a server mode. (The startime is actually what makes pylint laggy for small files, importing astroid takes around 0.4s which is unacceptable on each keystroke). I'm not sure you're going to be able to implement a server mode with file watchers, as you'd also need to clear the cache periodically. – Pierre.Sassoulas Apr 02 '23 at 18:18