From aaa532c8cdc7ba777dfdb277a1db254a2ae9d427 Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Sat, 25 Jun 2022 17:39:11 -0700 Subject: [PATCH] Analyze pull requests with Resyntax Analyze pull requests with Resyntax @samth expressed interest in setting up [Resyntax](https://docs.racket-lang.org/resyntax/) in the Typed Racket repository. This CL adds a github workflow which runs Resyntax on any changed files in a pull request. Resyntax will suggest changes in the form of a github review, [like this](https://github.com/jackfirth/racket-package-resyntax-action/pull/9#pullrequestreview-1019362007). To apply the changes, the pull request author simply need click the "Commit suggestion" button that shows up in each comment. Suggestions can also be ignored freely; the review does not block merges. The tool and the github integration are both still in the early phases so there are probably several bugs to work out here. If a suggestion looks wonky, @-mention me and I'll take a look at it. --- .github/workflows/resyntax.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/resyntax.yml diff --git a/.github/workflows/resyntax.yml b/.github/workflows/resyntax.yml new file mode 100644 index 000000000..6b66a4a55 --- /dev/null +++ b/.github/workflows/resyntax.yml @@ -0,0 +1,35 @@ +name: Resyntax + +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + - ready_for_review + +jobs: + build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + # See https://github.com/actions/checkout/issues/118. + with: + fetch-depth: 0 + - uses: Bogdanp/setup-racket@v1.8.1 + with: + version: current + packages: resyntax + local_catalogs: $GITHUB_WORKSPACE + dest: '"${HOME}/racketdist-current-CS"' + sudo: never + - name: Register local packages + run: | + raco pkg install -i --auto --no-setup --skip-installed typed-racket-test + raco pkg update --auto --no-setup source-syntax typed-racket-lib typed-racket-more typed-racket-compatibility typed-racket-doc typed-racket typed-racket-test + - run: raco setup typed typed-racket typed-racket-test typed-scheme + - run: xvfb-run racket -l- resyntax/cli analyze --local-git-repository . "origin/${GITHUB_BASE_REF}" --output-as-github-review