Sign up to save tools and stay up to date with the latest in AI
bg
bg
1

GitHub - getgrit/gritql: GritQL is a query language for searching, linting, and modifying code.

Mar 20, 2024 - github.com
GritQL is a declarative query language designed for searching and modifying source code. It allows users to start without learning AST details, use Rust and query optimization for scaling up to large repositories, and use Grit's built-in module system to reuse standard patterns or share their own. GritQL can be used to rewrite any target language and includes auto-fix rules for faster remediation. Users can get started by reading the documentation, interactive tutorial, or running `grit --help`.

The language was developed from experiences with large scale refactors and migrations, aiming to provide a powerful middle ground for codemod programs. It allows for easy exploratory analysis, incremental complexity addition, pattern reuse, and high performance due to being written in Rust. GritQL uses tree-sitter for all language parsers and benefits from the Rust ecosystem. It is released under the MIT license and welcomes contributions.

Key takeaways:

  • GritQL is a declarative query language for searching and modifying source code, designed to scale up to 10M+ line repositories.
  • It allows you to start simply without learning AST details and includes auto-fix rules for faster remediation.
  • GritQL can be used to rewrite any target language including JavaScript/TypeScript, Python, JSON, Java, Terraform, Solidity, CSS, Markdown, YAML, Rust, Go, or SQL.
  • GritQL is designed for easy exploratory analysis, incremental complexity addition, query reuse, and high performance, making it a powerful tool for large scale refactors and migrations.
View Full Article

Comments (0)

Be the first to comment!