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

"unused variable" does not appear when variable with same name in other file #366

Open
dpinol opened this issue Sep 25, 2024 · 0 comments
Open

Comments

@dpinol
Copy link

dpinol commented Sep 25, 2024

It looks like running vulture with confidence=100, is not reporting "unused variable" for function arguments named as other variables in other files. However, this does not happen if the "other variable" occurs in the same file.

kk.py

def kk():
    expr:int =3
 
def fn2(expr: int, expr2: int) -> None:
    pass
 
def qq():
    expr:int =3

kk()
fn2()
qq()

qq.py

def io():
    expr2=3
    return expr2

io()

See that it complain about expr argument in fn2 declaration, but does not complain about expr2.

vulture --min-confidence=10 kk.py qq.py
kk.py:3: unused variable 'expr' (60% confidence)
kk.py:5: unused variable 'expr' (100% confidence)
kk.py:9: unused variable 'expr' (60% confidence)

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant