PyCQA / eradicate

Removes commented-out code from Python files
https://pypi.python.org/pypi/eradicate
206 stars 25 forks source link

Misses methods declaration with annotated return types #8

Closed sobolevn closed 5 years ago

sobolevn commented 6 years ago

Hi, thanks for this awesome plugin. I am using it in production, it works great. However, I have found out that it misses this case:

-# class CommentedClass(object):
 #     def __init__(self, prop: int) -> None:
-#         self.property = prop

 #     def __str__(self) -> str:
-#         return self.__class__.__name__

-#    def set_prop(self, prop: int):
-#        self.prop = prop

-#    def get_prop(self):
-#        return self.prop

Look, all method declarations with annotated return types are ignored in this diff. The same goes for the regular functions, not just methods. This may lead to some false negative behavior.

P.S. I have made a flake8 plugin to check my codebase with eradicate, check it out: https://github.com/sobolevn/flake8-eradicate

myint commented 5 years ago

Closed by #10.

sobolevn commented 5 years ago

@myint awesome! Thank you.

Do you plan to release it sometime soon?

myint commented 5 years ago

@sobolevn Just released:

https://pypi.org/project/eradicate/1.0/