nhoad / flake8-unused-arguments

Flake8 plugin to warn against unused arguments in functions
MIT License
31 stars 8 forks source link

Explicitly marking arguments as "okay to be unused" #5

Closed bear24rw closed 3 years ago

bear24rw commented 3 years ago

I have some function where it is okay that I am not using the argument. It would be nice to easily mark those arguments so they don't get flaged.

Possible solutions:

1) if argument name starts with _ then ignore it

def foo(_bar):
    print("_bar is ignored")

2) Unused type annotation

from something import Unused
def foo(bar: Unused):
    print("bar is ignored")
bear24rw commented 3 years ago

I just realized option 1 is already supported if I disable U101, closing!