Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle user-raised deprecation warning by pylint

Tags:

python

pylint

Is there a way to tell pylint that it must show warning message when it see user-defined deprecation warning?

I've tried warnings.warn, DeprecationWarning - but pylint ignores them.

like image 203
Roman Bodnarchuk Avatar asked Dec 20 '25 17:12

Roman Bodnarchuk


1 Answers

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).

like image 138
Alex Martelli Avatar answered Dec 22 '25 09:12

Alex Martelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!