Never tried it, but Pylint is pretty pluggable and it looks like extending it will be much more flexible than chasing through the raw ast representation.
https://breadcrumbscollector.tech/writing-custom-checkers-for-pylint/
Also should let us get two birds with one stone.