File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,9 @@ jobs:
184
184
run : |
185
185
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
186
186
rustup override set ${{ env.TOOLCHAIN }}
187
+ - name : Install rustfmt
188
+ run : |
189
+ rustup component add rustfmt
187
190
- name : Install dependencies for honggfuzz
188
191
run : |
189
192
sudo apt-get update
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+ RUSTFMT () {
4
+ VERS=" "
5
+ [ " $( which rustup) " != " " ] && VERS=" +1.63.0"
6
+
7
+ rustfmt " $VERS " -- " $1 "
8
+ }
9
+
3
10
echo " #include <stdint.h>" > ../../targets.h
4
11
GEN_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"
6
13
echo " void $1 _run(const unsigned char* data, size_t data_len);" >> ../../targets.h
14
+ RUSTFMT " $1 _target.rs"
7
15
}
8
16
9
17
GEN_TEST bech32_parse
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+ RUSTFMT () {
4
+ VERS=" "
5
+ [ " $( which rustup) " != " " ] && VERS=" +1.63.0"
6
+
7
+ rustfmt " $VERS " -- " $1 "
8
+ }
9
+
3
10
GEN_TEST () {
4
11
tn=msg_$( echo $1 | sed s' /.*:://g' | sed ' s/\([a-z0-9]\)\([A-Z]\)/\1_\2/g' | tr ' [:upper:]' ' [:lower:]' )
5
12
fn=${tn} .rs
6
13
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
7
15
echo " pub mod $tn ;" >> mod.rs
8
16
}
9
17
10
- echo " mod utils;" > mod.rs
18
+ {
19
+ echo " #[rustfmt::skip]"
20
+ echo " mod utils;"
21
+ } > mod.rs
11
22
12
23
# Note when adding new targets here you should add a similar line in src/bin/gen_target.sh
13
24
@@ -64,3 +75,5 @@ GEN_TEST lightning::ln::msgs::Stfu test_msg_simple ""
64
75
GEN_TEST lightning::ln::msgs::Splice test_msg_simple " "
65
76
GEN_TEST lightning::ln::msgs::SpliceAck test_msg_simple " "
66
77
GEN_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