From 865c0b79af95b72790e4f4350d64297ee2b8ec61 Mon Sep 17 00:00:00 2001 From: Will Binns-Smith Date: Mon, 3 Jun 2024 09:40:38 -0700 Subject: [PATCH] Use ast-grep GitHub action and pin versions This uses the official ast-grep GitHub Action [0] instead of installing it from npm in the clippy job. Thanks for the suggestion from @HerringtonDarkholme! [0] https://github.com/ast-grep/action [1] https://github.com/vercel/turbo/pull/5637#issuecomment-1666751193 --- .github/workflows/turborepo-test.yml | 16 ++++++++++++---- .vscode/extensions.json | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/turborepo-test.yml b/.github/workflows/turborepo-test.yml index c48db48e79eed9..121b00694c0728 100644 --- a/.github/workflows/turborepo-test.yml +++ b/.github/workflows/turborepo-test.yml @@ -314,6 +314,18 @@ jobs: run: | cargo groups check turborepo-libraries --features rustls-tls + # From https://github.com/ast-grep/action/tree/v1.4/?tab=readme-ov-file#basic + ast-grep-lint: + runs-on: ubuntu-latest + name: Run ast-grep lint + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: ast-grep lint step + uses: ast-grep/action@v1.4 + with: + version: 0.22.5 + rust_clippy: needs: [rust_check] name: Turborepo rust clippy @@ -335,10 +347,6 @@ jobs: run: | cargo groups clippy turborepo-libraries --features rustls-tls -- --deny clippy::all - - name: Run ast-grep lints - run: | - npx --package @ast-grep/cli -- ast-grep scan $(cargo groups list turborepo-libraries | awk '{ print $2 }' | tr '\n' ' ') - rust_test: needs: [rust_check] strategy: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ad340c8680b832..4727b2583bd31e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -17,6 +17,7 @@ "windmilleng.vscode-go-autotest", "yzhang.markdown-all-in-one", "zxh404.vscode-proto3", - "mihaipopescu.Cram" + "mihaipopescu.Cram", + "ast-grep.ast-grep-vscode" ] }