Skip to content

Commit

Permalink
Analyze pull requests with Resyntax
Browse files Browse the repository at this point in the history
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](jackfirth/racket-package-resyntax-action#9 (review)). 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.
  • Loading branch information
jackfirth authored and samth committed Jun 26, 2022
1 parent 5c293e3 commit fa598b6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/resyntax.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit fa598b6

Please sign in to comment.