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

Possible false-negative for unused-argument when function always raises #9935

Open
e-gebes opened this issue Sep 19, 2024 · 1 comment
Open
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling

Comments

@e-gebes
Copy link

e-gebes commented Sep 19, 2024

Bug description

def function1(value):  # argument is used
    return value


def function2(value):  # argument is unused, Pylint correctly reports it
    return 2


def function3(value):  # argument is unused, Pylint does not report
    raise ValueError

Configuration

No response

Command used

pylint a.py

Pylint output

************* Module a
5:14: W0613: Unused argument 'value' (unused-argument)

Expected behavior

I would expect that also in case of an unconditional raise the argument would be reported as unused.

Pylint version

pylint 2.17.7
astroid 2.15.8
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]

OS / Environment

No response

Additional dependencies

No response

@e-gebes e-gebes added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 19, 2024
@pylint-dev pylint-dev deleted a comment Sep 19, 2024
@akamat10
Copy link
Contributor

This can be reproduced with the latest pylint version. Seems to be a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling
Projects
None yet
Development

No branches or pull requests

2 participants