Sylver is an open-source multi-language linter that allows the user to define custom rules by using a small built-in query language (https://docs.sylver.dev/docs/dsl/sylq).
Besides custom linting rules, the user can add support for an entire programming language by using a custom grammar description language. (more info at https://docs.sylver.dev/docs/dsl/meta-lang).
I’m in the process of building a registry of rulesets for different languages so that the tool can also be approached as a traditional linter. The first rulesets for Python are available at https://github.com/sylver-dev/rulesets.