albertas / deadcode

Find and fix unused Python code using command line.
GNU Affero General Public License v3.0
56 stars 1 forks source link

noqa doesn't work for decorated functions #4

Open bra-fsn opened 5 months ago

bra-fsn commented 5 months ago

With an unused function, this works:

def check(arg):  # noqa: DC002
    pass

but this doesn't:

@cache
def check(arg):  # noqa: DC002
    pass

This works again, but I don't think it should be valid:

@cache  # noqa: DC002
def check(arg):
    pass

Adding more decorators yields an error again.