Meet ast-grep: a Rust-based tool for code searching, linting, rewriting using AST

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ast-grep

    ⚡A CLI tool for code structural search, lint and rewriting. Written in Rust

  • Hey folks! I'm writing a tool like a hybrid of grep, eslint and codemod, for almost all tree-sitter compatile languages. The front page is https://ast-grep.github.io/.

  • comby

    A code rewrite tool for structural search and replace that supports ~every language.

  • How does it compare to https://github.com/comby-tools/comby, which can work on languages it doesnt even have grammars for (to a degree)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • weggli

    weggli is a fast and robust semantic search tool for C and C++ codebases. It is designed to help security researchers identify interesting functionality in large codebases.

  • I use weggli quite frequently for security analysis. Are there any plans for friendly competition in terms of equivalent features (not:, subexpressions, etc.).

  • yew

    Rust / Wasm framework for creating reliable and efficient web applications

  • Thanks for your interest! I hoped ast-grep can help you find (potentially bad) code and do some basic refactoring. For open-source maintainers, it can help them to ship breaking changes more easily. yew.rs is changing their use_effect API and ast-grep helped for users to migrate. https://yew.rs/docs/next/migration-guides/yew/from-0\_20\_0-to-next

  • eslint

  • This is an example to run an eslint rule using ast-grep. https://github.com/ast-grep/eslint/blob/main/rules/array-callback-return.yml

  • helix

    A post-modern modal text editor.

  • Perfect or not, it’s been nice to see so many languages standardize with LSPs and tree-sitter lately. I like Helix quite a bit, which takes advantage of that (and the AST-based navigation is neat), and I was actually just recently wondering if there was a tree-sitter based linter I could use on anything, so this is perfect timing.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts