diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2e965666424f3..00e15f6ffb480c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -284,3 +284,22 @@ jobs: run: pnpm build && pnpm test - run: git diff --exit-code if: steps.filter.outputs.src == 'true' + + ast-grep: + name: AST Grep + runs-on: ubuntu-latest + steps: + - uses: taiki-e/checkout-action@v1 + - uses: Boshen/setup-rust@main + with: + restore-cache: false + tools: ast-grep + - name: Check Char and Byte Offset + id: ast_grep + run: | + output=$(sg -p '$A.chars().enumerate()' -r '$A.char_indices()' -l rs) + echo "Output: $output" + if [ -n "$output" ]; then + echo "Error: Unexpected output detected" + exit 1 + fi