Skip to content
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

False positive no-value-for-parameter in Pylint 2.5 #3563

Closed
selimb opened this issue May 1, 2020 · 2 comments
Closed

False positive no-value-for-parameter in Pylint 2.5 #3563

selimb opened this issue May 1, 2020 · 2 comments
Labels

Comments

@selimb
Copy link

selimb commented May 1, 2020

Steps to reproduce

In bug.py:

"""Whatever"""
import os

def good(*parts):
    """All good"""
    return os.path.join(*parts)

def bad(*parts):
    """False positive below this line"""
    ret = os.path.join(*parts)
    return ret

Run pylint bug.py (no user config necessary).

Current behavior

In Pylint==2.5.0 (see below for detailed versions):

************* Module bug
bug.py:10:10: E1120: No value for argument 'a' in function call (no-value-for-parameter)

------------------------------------------------------------------
Your code has been rated at 1.67/10 (previous run: 1.67/10, +0.00)

With Pylint<2.5:


-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 1.67/10, +8.33)

Expected behavior

good and bad are effectively the same thing, and both are bug-free. I would expect no errors from Pylint.

Also, I don't get why the argument name is inferred as a?

>>> import inspect
>>> inspect.signature(os.path.join)
<Signature (path, *paths)>

pylint --version output

For Pylint==2.5.0 (first case above):

pylint 2.5.0
astroid 2.4.0
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]

For Pylint<2.5:

pylint 2.4.4
astroid 2.3.3
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]
@selimb
Copy link
Author

selimb commented May 2, 2020

Wow that was quick. Thanks!

@DervishD
Copy link

Sorry for waking this up, but I'm having the same error with pylint 2.6.2, astroid 2.4.2.

Is this known or do I have to open a new bug?

ibaoger pushed a commit to ibaoger/pdfium that referenced this issue Nov 24, 2021
This CL includes:
* set Pylint version to 2.7
* pass skip_shebang_check=True to RunUnitTestsInDirectory

And fixes some Pylint warnings:
* W0406: fix import-self
* E1101: Set name and aliases as an abstract property in
  encode_pdf_filter.py since name and aliases are introduced in
  subclasses.
* E0012: Remove Py2 hint of # pylint: disable=relative-import
* R0205: Replace all "class ClassName(objects)" with "class ClassName"
* E1120: Ignore this error. see
  pylint-dev/pylint#3563
* W0707: explicitly re-raising using the 'from' keyword

Bug: pdfium:1674, chromium:1262354, chromium:1262297
Change-Id: I205d254514f1ae667af818c789b5e6d89a061c68
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/87270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants