Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
evmar committed Sep 15, 2024
1 parent d82b684 commit 8b707d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: check out
uses: actions/checkout@v4
# TODO: use misc/fmt.sh
- run: cargo fmt -- --check || echo 'run `cargo fmt` to format your code'
name: check formatting
- uses: actions/checkout@v4
- run: |
if [ ! -f $HOME/.dprint ]; then
curl -fsSL https://dprint.dev/install.sh | sh
fi
- run: ./misc/fmt.sh --check
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ sudo apt install libsdl2-dev

## CLI build

Build/run the CLI app:
Build/run the CLI app:

```
$ cargo build -p retrowin32 -F x86-emu,sdl --profile=lto
Expand Down
17 changes: 14 additions & 3 deletions misc/fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

# Run all code formatters.

set -e
set -Ee

cargo fmt
web/node_modules/.bin/dprint fmt
if [ "$1" = "--check" ]; then
if ! (
cargo fmt -- --check &&
web/node_modules/.bin/dprint check
); then
echo
echo "error: formatting check failed; run 'misc/fmt.sh' to fix"
exit 1
fi
else
cargo fmt
web/node_modules/.bin/dprint fmt
fi

0 comments on commit 8b707d5

Please sign in to comment.