Skip to content

Commit 481a43d

Browse files
refactor: move nightly fmt check to rust_fmt.sh script
1 parent 0ed928f commit 481a43d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,10 @@ jobs:
587587
uses: ./.github/actions/setup-builder
588588
with:
589589
rust-version: stable
590-
- name: Setup nightly Rust toolchain
591-
run: rustup toolchain install nightly --component rustfmt
592590
- name: Run cargo fmt check (including doc comments)
593591
run: |
594592
echo '' > datafusion/proto/src/generated/datafusion.rs
595-
cargo +nightly fmt --all -- --check --config format_code_in_doc_comments=true
593+
ci/scripts/rust_fmt.sh
596594
597595
# Coverage job disabled due to
598596
# https://github.com/apache/datafusion/issues/3678

ci/scripts/rust_fmt.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@
1818
# under the License.
1919

2020
set -ex
21-
cargo fmt --all -- --check
21+
22+
# Install nightly toolchain (skips if already installed)
23+
rustup toolchain install nightly --component rustfmt
24+
25+
# Use nightly rustfmt to check formatting including doc comments
26+
# This requires nightly because format_code_in_doc_comments is an unstable feature
27+
cargo +nightly fmt --all -- --check --config format_code_in_doc_comments=true

0 commit comments

Comments
 (0)