File tree Expand file tree Collapse file tree 6 files changed +817
-258
lines changed Expand file tree Collapse file tree 6 files changed +817
-258
lines changed Original file line number Diff line number Diff line change @@ -216,3 +216,20 @@ jobs:
216216 - name : Run default clippy linting
217217 run : |
218218 cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else -Dclippy::try_err
219+
220+ rustfmt :
221+ runs-on : ubuntu-latest
222+ env :
223+ TOOLCHAIN : 1.63.0
224+ steps :
225+ - name : Checkout source code
226+ uses : actions/checkout@v3
227+ - name : Install Rust ${{ env.TOOLCHAIN }} toolchain
228+ run : |
229+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
230+ rustup override set ${{ env.TOOLCHAIN }}
231+ - name : Install rustfmt
232+ run : |
233+ rustup component add rustfmt
234+ - name : Run rustfmt checks
235+ run : ci/rustfmt.sh
Original file line number Diff line number Diff line change @@ -120,7 +120,15 @@ Coding Conventions
120120------------------
121121
122122Use tabs. If you want to align lines, use spaces. Any desired alignment should
123- display fine at any tab-length display setting.
123+ display fine at any tab-length display setting. We use ` rustfmt ` to establish
124+ uniform coding standards throughout the codebase. Please run
125+
126+ ``` bash
127+ ./ci/rustfmt.sh
128+ ```
129+
130+ before committing and pushing any changes, as compliance will also be checked
131+ and enforced by our CI scripts.
124132
125133Our CI enforces [ clippy's] ( https://github.com/rust-lang/rust-clippy ) default
126134linting
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -eox pipefail
3+
4+ # Generate initial exclusion list
5+ # find . -name '*.rs' -type f |sort >rustfmt_excluded_files
6+
7+ # Run fmt
8+ TMP_FILE=$( mktemp)
9+ find . -name ' *.rs' -type f | sort > $TMP_FILE
10+ for file in $( comm -23 $TMP_FILE rustfmt_excluded_files) ; do
11+ echo " Checking formatting of $file "
12+ rustfmt +1.63.0 --check $file
13+ done
You can’t perform that action at this time.
0 commit comments