File tree Expand file tree Collapse file tree 8 files changed +32
-24
lines changed Expand file tree Collapse file tree 8 files changed +32
-24
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # :
3+ # : name = "lint"
4+ # : variety = "basic"
5+ # : target = "helios-2.0"
6+ # : rust_toolchain = "nightly-2024-05-12"
7+ # : access_repos = [
8+ # : "oxidecomputer/illumos-rs",
9+ # : ]
10+ # :
11+
12+ set -o errexit
13+ set -o pipefail
14+ set -o xtrace
15+
16+ header " check style"
17+ ptime -m cargo xtask fmt --check
Original file line number Diff line number Diff line change @@ -26,9 +26,6 @@ cd crates/opte-api
2626header " check API_VERSION"
2727./check-api-version.sh
2828
29- header " check style"
30- ptime -m cargo +nightly-2024-05-12 fmt -- --check
31-
3229header " analyze std"
3330ptime -m cargo clippy --all-targets
3431
Original file line number Diff line number Diff line change @@ -23,8 +23,5 @@ rustc --version
2323
2424cd lib/opte-ioctl
2525
26- header " check style"
27- ptime -m cargo +nightly-2024-05-12 fmt -- --check
28-
2926header " analyze"
3027ptime -m cargo clippy --all-targets
Original file line number Diff line number Diff line change @@ -25,9 +25,6 @@ rustc --version
2525
2626cd lib/opte
2727
28- header " check style"
29- ptime -m cargo +nightly-2024-05-12 fmt -- --check
30-
3128header " check docs"
3229#
3330# I believe this means any doc warnings in deps will cause this to
Original file line number Diff line number Diff line change @@ -28,9 +28,6 @@ rustc --version
2828
2929pushd bin/opteadm
3030
31- header " check style"
32- ptime -m cargo +nightly-2024-05-12 fmt -- --check
33-
3431header " analyze"
3532ptime -m cargo clippy --all-targets
3633
Original file line number Diff line number Diff line change @@ -25,9 +25,6 @@ rustc --version
2525
2626cd lib/oxide-vpc
2727
28- header " check style"
29- ptime -m cargo +nightly-2024-05-12 fmt -- --check
30-
3128header " check docs"
3229#
3330# I believe this means any doc warnings in deps will cause this to
Original file line number Diff line number Diff line change @@ -78,9 +78,6 @@ pushd xde
7878
7979cp xde.conf /work/xde.conf
8080
81- header " check style"
82- ptime -m cargo +nightly-2024-05-12 fmt -p xde -p xde-link -- --check
83-
8481header " analyze"
8582ptime -m cargo clippy -- \
8683 --allow clippy::uninlined-format-args --allow clippy::bad_bit_mask
Original file line number Diff line number Diff line change @@ -61,7 +61,11 @@ enum Xtask {
6161 } ,
6262
6363 /// Format the repository with `rustfmt`.
64- Fmt ,
64+ Fmt {
65+ /// Run rustfmt in check mode.
66+ #[ arg( long) ]
67+ check : bool ,
68+ } ,
6569}
6670
6771#[ derive( Debug , Args ) ]
@@ -140,17 +144,22 @@ fn main() -> anyhow::Result<()> {
140144
141145 Ok ( ( ) )
142146 }
143- Xtask :: Fmt => {
147+ Xtask :: Fmt { check } => {
144148 let meta = cargo_meta ( ) ;
145149
146150 // This is explicitly `cargo` rather than CARGO as we might
147151 // be swapping toolchains to do this from the current cargo.
148- Command :: new ( "cargo" )
149- . arg ( format ! ( "+{}" , get_current_nightly_toolchain( ) ?) )
152+ let mut c = Command :: new ( "cargo" ) ;
153+ c . arg ( format ! ( "+{}" , get_current_nightly_toolchain( ) ?) )
150154 . args ( [ "fmt" , "--all" ] )
151155 . env_remove ( "RUSTUP_TOOLCHAIN" )
152- . current_dir ( & meta. workspace_root )
153- . output_nocapture ( ) ?;
156+ . current_dir ( & meta. workspace_root ) ;
157+
158+ if check {
159+ c. arg ( "--check" ) ;
160+ }
161+
162+ c. output_nocapture ( ) ?;
154163
155164 Ok ( ( ) )
156165 }
You can’t perform that action at this time.
0 commit comments