Monday 2 November 2020

lint usages of functions with @deprecated decorator

Is there a linter that detects usages of functions that are marked as deprecated with the @deprecated decorator from the deprecated package?

e.g. in

from deprecated import deprecated

def realfun():
    print('Hey there')

@deprecated(reason="this is a test")
def myfun():
    realfun()

if __name__ == "__main__":
    myfun()

I will get a runtime warning when running it as PYTHONWARNINGS="default::DeprecationWarning" python testfile.py but pylint, mypy, and flake8 seem to be (at least how I run them) happy with calling myfun.



from lint usages of functions with @deprecated decorator

No comments:

Post a Comment