File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -176,14 +176,17 @@ jobs:
176176 fuzz :
177177 runs-on : ubuntu-latest
178178 env :
179- TOOLCHAIN : 1.63
179+ TOOLCHAIN : 1.63.0
180180 steps :
181181 - name : Checkout source code
182182 uses : actions/checkout@v3
183183 - name : Install Rust ${{ env.TOOLCHAIN }} toolchain
184184 run : |
185185 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
186186 rustup override set ${{ env.TOOLCHAIN }}
187+ - name : Install rustfmt
188+ run : |
189+ rustup component add rustfmt
187190 - name : Install dependencies for honggfuzz
188191 run : |
189192 sudo apt-get update
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3+ RUSTFMT () {
4+ VERS=" "
5+ [ " $( which rustup) " != " " ] && VERS=" +1.63.0"
6+
7+ rustfmt " $VERS " -- " $1 "
8+ }
9+
310echo " #include <stdint.h>" > ../../targets.h
411GEN_TEST () {
5- cat target_template.txt | sed s/TARGET_NAME/$1 / | sed s/TARGET_MOD/$2$1 / > $1 _target.rs
12+ cat target_template.txt | sed s/TARGET_NAME/$1 / | sed s/TARGET_MOD/$2$1 / > " $1 _target.rs"
613 echo " void $1 _run(const unsigned char* data, size_t data_len);" >> ../../targets.h
14+ RUSTFMT " $1 _target.rs"
715}
816
917GEN_TEST bech32_parse
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3+ RUSTFMT () {
4+ VERS=" "
5+ [ " $( which rustup) " != " " ] && VERS=" +1.63.0"
6+
7+ rustfmt " $VERS " -- " $1 "
8+ }
9+
310GEN_TEST () {
411 tn=msg_$( echo $1 | sed s' /.*:://g' | sed ' s/\([a-z0-9]\)\([A-Z]\)/\1_\2/g' | tr ' [:upper:]' ' [:lower:]' )
512 fn=${tn} .rs
613 cat msg_target_template.txt | sed s/MSG_TARGET/$1 / | sed " s/TARGET_NAME/$tn /" | sed " s/TEST_MSG/$2 /" | sed " s/EXTRA_ARGS/$3 /" > $fn
14+ RUSTFMT $fn
715 echo " pub mod $tn ;" >> mod.rs
816}
917
10- echo " mod utils;" > mod.rs
18+ {
19+ echo " #[rustfmt::skip]"
20+ echo " mod utils;"
21+ } > mod.rs
1122
1223# Note when adding new targets here you should add a similar line in src/bin/gen_target.sh
1324
@@ -64,3 +75,5 @@ GEN_TEST lightning::ln::msgs::Stfu test_msg_simple ""
6475GEN_TEST lightning::ln::msgs::Splice test_msg_simple " "
6576GEN_TEST lightning::ln::msgs::SpliceAck test_msg_simple " "
6677GEN_TEST lightning::ln::msgs::SpliceLocked test_msg_simple " "
78+
79+ RUSTFMT mod.rs
You can’t perform that action at this time.
0 commit comments