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

get_argument_from_call doesn't account for **kwargs #7761

Closed
jacobtylerwalls opened this issue Nov 13, 2022 · 4 comments · Fixed by #8775 or #9093
Closed

get_argument_from_call doesn't account for **kwargs #7761

jacobtylerwalls opened this issue Nov 13, 2022 · 4 comments · Fixed by #8775 or #9093
Assignees
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Nov 13, 2022

Bug description

get_argument_from_call doesn't account for keyword arguments provided by unpacked kwargs. This is causing both false positives and false negatives

False negative

kw={'mode': 'garbage'}
open(fp, **kw)

False positive

kw={'maxsplit', 1}
'asdf'.split('s', **kw)[-1]

Configuration

No response

Command used

pylint c.py

Pylint output

first example: nothing

Expected behavior

first example: Expected a warning for bad-open-mode

Pylint version

pylint 2.16.0-dev
astroid 2.13.0-dev0
Python 3.11.0 (v3.11.0:deaf509e8f, Oct 24 2022, 14:43:23) [Clang 13.0.0 (clang-1300.0.29.30)]

OS / Environment

No response

Additional dependencies

No response

@jacobtylerwalls jacobtylerwalls added Good first issue Friendly and approachable by new contributors False Positive 🦟 A message is emitted but nothing is wrong with the code False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation labels Nov 13, 2022
@LeetaoGoooo
Copy link

I'd like to work on this if there are nobody else~

@jacobtylerwalls
Copy link
Member Author

Terrific. Thanks for volunteering.

@jacobtylerwalls
Copy link
Member Author

Hi @LeetaoGoooo, just an update. #8728 did a good portion of this issue, so I'll just pick up from here and look at the remaining false negatives. Let us know if you want any direction about something else to help out with!

@jacobtylerwalls jacobtylerwalls removed the Good first issue Friendly and approachable by new contributors label Jun 13, 2023
@jacobtylerwalls jacobtylerwalls added this to the 3.0.0a7 milestone Jun 13, 2023
@jacobtylerwalls jacobtylerwalls removed the False Positive 🦟 A message is emitted but nothing is wrong with the code label Jun 13, 2023
jacobtylerwalls added a commit to jacobtylerwalls/pylint that referenced this issue Jun 13, 2023
These mostly solve false negatives for various checks,
save for one false positive for `use-maxsplit-arg`.

Closes pylint-dev#7761
@LeetaoGoooo
Copy link

Hi @LeetaoGoooo, just an update. #8728 did a good portion of this issue, so I'll just pick up from here and look at the remaining false negatives. Let us know if you want any direction about something else to help out with!

Thank you for letting me know about the progress on the issue. I'm glad to hear that #8728 was able to address a good portion of it. If there's anything else you think I can help with, please don't hesitate to let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
2 participants