-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Duplicated or even bugged result if launching pylint on the same file multiple time #4053
Comments
Hello, thank you for opening the issue, could you provide the real call that is being made when launching pylint that is producing the bug ? Especially thing like the number of core used with |
There really is no mystery to it, I need not use any options:
This is on:
What I meant to test is that the import error is reported twice, in fact everything is, that is already annoying, but duplicating errors is not a big deal, however this is:
You can find the file I use here: https://github.com/Nuitka/Nuitka/blob/develop/nuitka/Constants.py Basically it just takes a limit, any limit I assume, that is not exceeded by a factory of 2. I bet that provided the filename many more times will make it worse. As you can see, it doesn't take any options, although I override default limits, I don't have any pylint config in action in my examples here. |
Thank you I can reproduce this bug: With a file # pylint: disable=too-many-return-statements,inconsistent-return-statements,no-else-return,
def getUnhashableConstant(constant):
constant_type = type(constant)
if constant_type in (str,):
return None
elif constant_type in (dict, list, set):
return constant
elif constant_type is tuple:
for value in constant:
res = getUnhashableConstant(value)
if res is not None:
return res
return None
elif constant is Ellipsis:
return None
elif constant_type is slice:
return None
else:
assert False, constant_type
|
On top of that in 2.15.0-dev0 we also get an additional |
The order of files also needs to be considered when fixing this see #3661 |
Closely related to #689 |
I think that this bug is also related to #6242 . |
Closes pylint-dev#6242 May also address pylint-dev#4053
…#7747) * Use dict for 'expand_modules' result rather than list. With 'path' as the key, we get deduplication for free and do not need to reprocess the list for deduplication later. * Fix deduplication to account for CLI args marker. * Fix corner case with CLI arg flag handling during deduplication. * Add 'deduplication' to custom Pyenchant dict. Closes pylint-dev#6242 Closes pylint-dev#4053 Co-authored-by: Eric McDonald <emcd@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Use dict for 'expand_modules' result rather than list. With 'path' as the key, we get deduplication for free and do not need to reprocess the list for deduplication later. * Fix deduplication to account for CLI args marker. * Fix corner case with CLI arg flag handling during deduplication. * Add 'deduplication' to custom Pyenchant dict. Closes #6242 Closes #4053 Co-authored-by: Eric McDonald <emcd@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
I have a mode for calling pylint on only the changed files from git, and I was giving it the staged changes and the unstages changes, causing sometimes files to duplicate. More than once, this has caused too many branches to be reported on files, where if the file is only given once, this is not happening, and it's a false alarm.
Steps to reproduce
Current behavior
False alarms are given
Expected behavior
I think that pylint should recognize, probably through making it absolute paths, if files are really the same, and then only work on one of them, or report on both files separately. Right now it seems as though the source of 2 files gets assigned to one target internally.
pylint --version output
pylint 2.6.0
astroid 2.4.2
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0]
It's happening everywhere as far as I can tell.
Yours,
Kay
The text was updated successfully, but these errors were encountered: