-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI for formatting via verusfmt (#8)
* ci: add verusfmt checks * dos2unix line breaks * run verusfmt on all tasks/*.rs
- Loading branch information
1 parent
7554df4
commit 20020bd
Showing
4 changed files
with
604 additions
and
547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ubuntu-latest | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,4 +263,3 @@ def check(candidate): | |
assert candidate('( ) (( )) (( )( ))') == ['()', '(())', '(()())'] | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.