File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ display fine at any tab-length display setting. We use `rustfmt` to establish
124
124
uniform coding standards throughout the codebase. Please run
125
125
126
126
``` bash
127
- ./ci/ rustfmt.sh
127
+ ./contrib/run- rustfmt.sh
128
128
```
129
129
130
130
before committing and pushing any changes, as compliance will also be checked
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -eox pipefail
3
3
4
+ export LC_ALL=C
5
+
4
6
# Generate initial exclusion list
5
7
# find . -name '*.rs' -type f |sort >rustfmt_excluded_files
6
8
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eo pipefail
3
+
4
+ export LC_ALL=C
5
+
6
+ # Generate initial exclusion list
7
+ # find . -name '*.rs' -type f |sort >rustfmt_excluded_files
8
+
9
+ # The +rustversion syntax only works with rustup-installed rust toolchains,
10
+ # not with any distro-provided ones. Thus, we check for a rustup install and
11
+ # only pass +1.63.0 if we find one.
12
+ VERS=" "
13
+ [ " $( which rustup) " != " " ] && VERS=" +1.63.0"
14
+
15
+ # Run fmt
16
+ TMP_FILE=$( mktemp)
17
+ find . -name ' *.rs' -type f | sort > $TMP_FILE
18
+ for file in $( comm -23 $TMP_FILE rustfmt_excluded_files) ; do
19
+ echo " Formatting $file ..."
20
+ rustfmt $VERS --edition 2021 $file
21
+ done
You can’t perform that action at this time.
0 commit comments