Tree-sitter queries allow you to search for patterns in syntax trees, much like a regex would, in text. Combine that with some Rust glue to write simple, custom linters. Tree-sitter syntax trees Here is a quick crash course on syntax trees generated by tree-sitter. Syntax trees produced by tree-sitter are represented by S-expressions. The generated S-expression for the following Rust code, fn main() {let x =2;} would be: (source_file (function_item name: (identifier) parameters: (parameters) ...