pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.33k stars 1.14k forks source link

Make function/method deprecation checks reusable to plugins #4049

Closed matusvalo closed 3 years ago

matusvalo commented 3 years ago

Is your feature request related to a problem? Please describe

stdlib checker contains checks for deprecated functions: https://github.com/PyCQA/pylint/blob/8649b721560ac33756792e405a6d7bbf7d331e57/pylint/checkers/stdlib.py#L112-L118 Unfortunately, there is no easy way how it can be simply reused to add support for deprecation checks in pylint plugins.

Describe the solution you'd like

One possible solution can be to move deprecation check logic to separate Mixin and provide hooks for customization. The plugin can create new checker by using the mixin and just adding small custom pieces.

Additional context

Generalizing deprecation check logic from stdlib to be reused in plugins. Ideal candidate is e.g. pyling-django.

Pierre-Sassoulas commented 3 years ago

This sounds reasonable, I don't have a better proposition regarding the implementation itself.