Skip to content

Commit 25f8be2

Browse files
committed
Makefile: update format task to handle in-macro rust fmt
This papers around a `cargo fmt` limitation that leaves code within the `ffi_panic_boundary!` macros unformatted. By also adding this to `format-check`, we'll get CI enforcement to prevent backsliding.
1 parent 580d6b0 commit 25f8be2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,17 @@ format:
6969
-name '*.[c|h]' \
7070
! -wholename 'src/rustls.h' | \
7171
xargs clang-format -i
72+
sed -i -e 's/ffi_panic_boundary! {/if true {/g' src/*.rs
73+
cargo fmt
74+
sed -i -e 's/if true {/ffi_panic_boundary! {/g' src/*.rs
7275

7376
format-check:
7477
find src tests \
7578
-name '*.[c|h]' \
7679
! -wholename 'src/rustls.h' | \
7780
xargs clang-format --dry-run -Werror -i
81+
sed -i -e 's/ffi_panic_boundary! {/if true {/g' src/*.rs
82+
cargo fmt --check
83+
sed -i -e 's/if true {/ffi_panic_boundary! {/g' src/*.rs
7884

7985
.PHONY: all clean test integration format format-check

0 commit comments

Comments
 (0)