leinardi / pylint-pycharm

A plugin providing both real-time and on-demand scanning of Python files with PyLint from within PyCharm/IDEA.
Apache License 2.0
200 stars 36 forks source link

Stopping old instances of PyLint when requesting new ones #11

Closed bivald closed 2 years ago

bivald commented 6 years ago

First of all, I love this plugin. I really want to see it grow and I will try to help out any way I can.

Is your feature request related to a problem? Please describe. Two scenarios:

  1. If I run Inspect Code a few times, fixing bugs I can easily get 20 python processess all running PyLint all using 100% each. Up to 40 python processes for lint on save. image

  2. If I jump around looking for things in my source I get a lot of Python processes, since PyLint is executed every time a file comes into view. A 300-400 line python file can easily take 5-10 seconds to lint.

Describe the solution you'd like It would be nice of one could enable a feature that will abort the previously running PyLints when running a new Inspect Code. That way the old ones won't keep stacking up when they are irrelevant.

Describe alternatives you've considered Speeding up PyLint (but that requires more cores usually, which might be counter intuitive. Some warning that PyLint won't run again since it's already running in the background.

Additional context This is a hard thing to implement and I'm not sure what the best course of action would be. Perhaps options such as:

  1. Only run PyLint on save
  2. Kill old PyLint processess on Inspect Code
  3. Only run PyLint on Code Inspection (not on save)
  4. Kill old PyLint processess on save (when run PyLint on save is enabled)

Questions

leinardi commented 6 years ago

Hey, this seems to be quite a hard issue to fix, I have to investigate more if the IntelliJ Platform SDK offers already something that could help.

If the real-time inspection is consuming too many resources just keep in mind that, as temporary workaround, you can always disable it, just for the Pylint plugin, and only use the on-demand check: image

To answer your questions I have to do some tests and currently I can't, I will try to answer this evening.

bivald commented 6 years ago

Agreed, and it’s definitely possible it won’t be possible to fix it (since it’s not a bug per se). I will try to do my own digging as well.

switchtrue commented 6 years ago

This is becoming a real issue for me. It pretty well breaks pycharm after a while. But as suggested, disabling the real-time scan fixes the issue.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

SHxKM commented 5 years ago

I'm also experiencing very serious consequences of this.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity in the last 60 days.

chilicheech commented 3 years ago

It would be really nice to have this implemented. Specifically the killing of old pylint processes when it triggers new ones. Gotta keep track of which pylint processes it triggered in the past and only kill those to prevent killing pylint processes that don't belong to it.

leinardi commented 2 years ago

Thanks to @intgr's contribution to the Mypy Plugin, this feature has now been ported also to this plugin.

leinardi commented 2 years ago

A new version with the fix for this issue is currently pending review from JetBrains. It should become available in the next few days.