Skip to content

Commit

Permalink
ci: add verusfmt checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybosamiya committed Aug 22, 2024
1 parent 2c8e692 commit b2bc190
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/verusfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: verusfmt

on: [push, pull_request, workflow_dispatch]

jobs:
verusfmt-check:
runs-on: macos-14
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup verusfmt
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/verus-lang/verusfmt/releases/latest/download/verusfmt-installer.sh | sh
- name: check formatting
working-directory: ./tasks
run: |
# Run `verusfmt --check` on each file, collecting failures if any
ANYFAILED=""
for i in *.rs; do
echo -n "[fmt check] $i: "
if verusfmt --check "$i" >/dev/null 2>/dev/null; then
echo "success"
else
echo "failed"
# Re-run `verusfmt --check` on any failure just to display the actual output
verusfmt --check "$i" || true
ANYFAILED="$ANYFAILED $i"
fi
done
if [ -n "$ANYFAILED" ]; then
echo "Failed:$ANYFAILED"
exit 1
fi

0 comments on commit b2bc190

Please sign in to comment.