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

Dict unpacking within a context manager triggers missing-kwoa #8100

Closed
pR0Ps opened this issue Jan 23, 2023 · 0 comments · Fixed by #8101
Closed

Dict unpacking within a context manager triggers missing-kwoa #8100

pR0Ps opened this issue Jan 23, 2023 · 0 comments · Fixed by #8101
Assignees
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@pR0Ps
Copy link
Contributor

pR0Ps commented Jan 23, 2023

Bug description

Reproduction:

import contextlib

@contextlib.contextmanager
def f(*, a):
    yield
    
def g(**kw):
    f(**kw)  # doesn't trigger missing-kwoa
    with f(**kw):  # triggers missing-kwoa
        pass
        
g(a=1)

Seems related to #1111

Configuration

No response

Command used

pylint repro.py

Pylint output

$ pylint repro.py
************* Module repro
repro.py:6:0: C0303: Trailing whitespace (trailing-whitespace)
repro.py:11:0: C0303: Trailing whitespace (trailing-whitespace)
repro.py:1:0: C0114: Missing module docstring (missing-module-docstring)
repro.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
repro.py:4:0: C0103: Function name "f" doesn't conform to snake_case naming style (invalid-name)
repro.py:4:9: W0613: Unused argument 'a' (unused-argument)
repro.py:7:0: C0116: Missing function or method docstring (missing-function-docstring)
repro.py:7:0: C0103: Function name "g" doesn't conform to snake_case naming style (invalid-name)
repro.py:9:9: E1125: Missing mandatory keyword argument 'a' in function call (missing-kwoa)

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

Expected behavior

missing-kwoa shouldn't be triggered

Pylint version

pylint 2.15.10
astroid 2.13.3
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]

OS / Environment

No response

Additional dependencies

No response

@pR0Ps pR0Ps added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jan 23, 2023
@pR0Ps pR0Ps changed the title Dict unpacking within a context manager triggers missing-kwoa Dict unpacking within a context manager triggers missing-kwoa Jan 23, 2023
@clavedeluna clavedeluna added False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jan 23, 2023
@clavedeluna clavedeluna self-assigned this Jan 23, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Jan 23, 2023
clavedeluna added a commit that referenced this issue Jan 24, 2023
<!--
Thank you for submitting a PR to pylint!

To ease the process of reviewing your PR, do make sure to complete the
following boxes.

- [ ] Write a good description on what the PR does.
- [ ] Create a news fragment with `towncrier create
<IssueNumber>.<type>` which will be
included in the changelog. `<type>` can be one of: breaking,
user_action, feature,
new_check, removed_check, extension, false_positive, false_negative,
bugfix, other, internal.
If necessary you can write details or offer examples on how the new
change is supposed to work.
- [ ] If you used multiple emails or multiple names when contributing,
add your mails
      and preferred name in ``script/.contributors_aliases.json``
-->

## Type of Changes

<!-- Leave the corresponding lines for the applicable type of change:
-->

|     | Type                   |
| --- | ---------------------- |
| ✓   | 🐛 Bug fix          |


## Description

Fix ``no-kwoa`` false positive for context managers.

Closes #8100
clavedeluna added a commit to clavedeluna/pylint that referenced this issue Jan 24, 2023
<!--
Thank you for submitting a PR to pylint!

To ease the process of reviewing your PR, do make sure to complete the
following boxes.

- [ ] Write a good description on what the PR does.
- [ ] Create a news fragment with `towncrier create
<IssueNumber>.<type>` which will be
included in the changelog. `<type>` can be one of: breaking,
user_action, feature,
new_check, removed_check, extension, false_positive, false_negative,
bugfix, other, internal.
If necessary you can write details or offer examples on how the new
change is supposed to work.
- [ ] If you used multiple emails or multiple names when contributing,
add your mails
      and preferred name in ``script/.contributors_aliases.json``
-->

## Type of Changes

<!-- Leave the corresponding lines for the applicable type of change:
-->

|     | Type                   |
| --- | ---------------------- |
| ✓   | 🐛 Bug fix          |

## Description

Fix ``no-kwoa`` false positive for context managers.

Closes pylint-dev#8100
clavedeluna added a commit to clavedeluna/pylint that referenced this issue Jan 24, 2023
<!--
Thank you for submitting a PR to pylint!

To ease the process of reviewing your PR, do make sure to complete the
following boxes.

- [ ] Write a good description on what the PR does.
- [ ] Create a news fragment with `towncrier create
<IssueNumber>.<type>` which will be
included in the changelog. `<type>` can be one of: breaking,
user_action, feature,
new_check, removed_check, extension, false_positive, false_negative,
bugfix, other, internal.
If necessary you can write details or offer examples on how the new
change is supposed to work.
- [ ] If you used multiple emails or multiple names when contributing,
add your mails
      and preferred name in ``script/.contributors_aliases.json``
-->

## Type of Changes

<!-- Leave the corresponding lines for the applicable type of change:
-->

|     | Type                   |
| --- | ---------------------- |
| ✓   | 🐛 Bug fix          |

## Description

Fix ``no-kwoa`` false positive for context managers.

Closes pylint-dev#8100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants