Handle user-raised deprecation warning by pylint
Is there a way to tell pyl开发者_StackOverflowint that it must show warning message when it see user-defined deprecation warning?
I've tried warnings.warn, DeprecationWarning - but pylint ignores them.
Since warnings.warn
&c are intended to happen at runtime, Pylint by default doesn't see them as anything strange. To change that I think you need to follow the (advanced and scarce) docs for writing your own checker, with which you can emit warnings on any characteristics of the sources (either the raw ones or the AST-compiled level thereof).
精彩评论