nhoad / flake8-unused-arguments

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

Ignore dunder methods #16

Closed joaoe closed 2 years ago

joaoe commented 2 years ago

Another option, this time for dunder methods. The use case if that many dunder methods require arguments, like

class Foo:
  def __setitem__(self, item, value):
    raise ValueError("readonly")
  def __reduce_ex__(self, protocol):
    return ...
  def __exit__(self, exc_tp, exc_val, exc_tb):
    ...

IDEs will happily generate these methods for us, and people expect them to have certain signatures.

Also fixes https://github.com/nhoad/flake8-unused-arguments/issues/4

PS: you don't need to put my name on the README. The git history is enough. Thank you :)

nhoad commented 2 years ago

I somehow completely missed this, I'm sorry!! This looks really great. I'll comment here once I've made a release with this available.

nhoad commented 2 years ago

Done! 0.0.11 has been released with this. Thank you again!