-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using --jobs affects monkey patching detection #502
Comments
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): It's not just with multiple jobs, it fails by reversing the order of the files in the CLI command as well. It doesn't report in the first case, because pylint uses a global cache of modules, astroid.manager.AstroidManager.astroid_cache, so when it processes second.py, |
Original comment by Pavel Roskin (BitBucket: pavel_roskin): I think many people would prefer pylint to run ten times slower but detect 10% more issues. I'd rather run pylint overnight than release code where pylint failed to find a problem. Of course, slowing down pylint could also discourage people from using it in more casual situations (e.g. checking a trivial code change before committing it). If running pylint on every file individually would produce more reliable results at the expense of processing time, then maybe it could be an option? With that option enabled, all caches would be cleaned when pylint starts processing a new file. By the way, a reliable --jobs implementation would offset some of the additional time. Especially if --jobs is set by default to the number of CPUs. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Well, the question is if detecting monkey patching is a real problem. We'll have to investigate what other side effects the cleaning of cache has after all. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): An option sounds good. |
Original comment by Pavel Roskin (BitBucket: pavel_roskin): In my case, it wasn't a new information. It was already clear that defining However, I know that running pylint on individual files produces more data than running it on the whole module. I'll see if pylint would find anything useful by checking each file separately. That would produce a more realistic motivation for a possible option. |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Ah, that sounds perfect for additional-builtins option. |
~~Based on branch for PR pylint-dev#500 -- I will rebase after that PR merges.~~ Closes pylint-dev#367. Supersedes PR pylint-dev#497.
This bug, while ancient, is still reproducible in latest code on 2.15.0-dev0. |
Closing as duplicate of #374 |
Originally reported by: Pavel Roskin (BitBucket: pavel_roskin)
first.py:
second.py:
pylint -E first.py second.py
No output
pylint -E --jobs=2 first.py second.py
I'm actually fine if pylint reports that error in every case, as long as there is no
import first
in second.py beforesys.foo
is used. The original code that triggered the error message is overengineered and needs fixing.The text was updated successfully, but these errors were encountered: