
What is GritQL?
In this article, we review GritQL. I found grit.yaml in the char codebase . You will learn the following: What is GritQL? What is Char? Grit usage in Char codebase. What is GritQL? GritQL is a declarative query language for searching and modifying source code. Why GritQL? 📖 Start simply without learning AST details: any code snippet is a valid GritQL query ⚡️ Scale to millions of lines using Rust and query optimization for repositories with 10M+ lines 📦 Reuse patterns with Grit’s built-in module system to access 200+ standard patterns or share your own ♻️ Works everywhere: use GritQL to rewrite JavaScript/TypeScript, Python, JSON, Java, Terraform, Solidity, CSS, Markdown, YAML, Rust, Go, or SQL 🔧 Auto-fix built in: GritQL makes it easy to include auto-fix rules for faster remediation Examples Search for patterns using backticks and metavariables (like $msg ): grit apply '`console.log($msg)` => `winston.log($msg)`' Save patterns to enforce as custom lints, with powerful where clauses to
Continue reading on Dev.to
Opens in a new tab


