2
2
# ^ A shebang isn't required, but allows a justfile to be executed
3
3
# like a script, with `./justfile test`, for example.
4
4
5
+ j := quote (just_executable ())
6
+
7
+ # List available recipes
5
8
default :
6
- {{ just_executable () }} --list
9
+ {{ j }} --list
7
10
8
11
alias t := test
9
12
alias c := check
10
13
alias nt := nextest
11
14
12
- # run all tests, clippy, including journey tests, try building docs
15
+ # Run all tests, clippy, including journey tests, try building docs
13
16
test : clippy check doc unit-tests journey-tests-pure journey-tests-small journey-tests-async journey-tests check-mode
14
17
15
- # run all tests, without clippy, and try building docs
18
+ # Run all tests, without clippy, and try building docs
16
19
ci-test : check doc unit-tests check-mode
17
20
18
- # run all journey tests - should be run in a fresh clone or after `cargo clean`
21
+ # Run all journey tests - should be run in a fresh clone or after `cargo clean`
19
22
ci-journey-tests : journey-tests-pure journey-tests-small journey-tests-async journey-tests
20
23
24
+ # Clean the `target` directory
21
25
clear-target :
22
26
cargo clean
23
27
24
- # Run cargo clippy on all crates
28
+ # Run ` cargo clippy` on all crates
25
29
clippy * clippy -args :
26
30
cargo clippy --workspace --all-targets -- {{ clippy-args }}
27
31
cargo clippy --workspace --no-default-features --features small -- {{ clippy-args }}
28
32
cargo clippy --workspace --no-default-features --features max-pure -- {{ clippy-args }}
29
33
cargo clippy --workspace --no-default-features --features lean-async --tests -- {{ clippy-args }}
30
34
31
- # Run cargo clippy on all crates, fixing what can be fixed, and format all code
35
+ # Run ` cargo clippy` on all crates, fixing what can be fixed, and format all code
32
36
clippy-fix :
33
37
cargo clippy --fix --workspace --all-targets
34
38
cargo clippy --fix --allow-dirty --workspace --no-default-features --features small
@@ -143,12 +147,12 @@ check:
143
147
cargo check -p gix-odb --features serde
144
148
cargo check --no-default-features --features max-control
145
149
146
- # Run cargo doc on all crates
147
- doc $ RUSTDOCFLAGS = " -D warnings" :
150
+ # Run ` cargo doc` on all crates
151
+ doc $ RUSTDOCFLAGS = ' -D warnings' :
148
152
cargo doc --workspace --no-deps --features need-more-recent-msrv
149
153
cargo doc --features=max,lean,small --workspace --no-deps --features need-more-recent-msrv
150
154
151
- # run all unit tests
155
+ # Run all unit tests
152
156
unit-tests :
153
157
cargo nextest run
154
158
cargo test --doc
@@ -158,9 +162,9 @@ unit-tests:
158
162
cargo nextest run -p gix-archive --features tar
159
163
cargo nextest run -p gix-archive --features tar_gz
160
164
cargo nextest run -p gix-archive --features zip
161
- cargo nextest run -p gix-status-tests --features " gix-features-parallel"
162
- cargo nextest run -p gix-worktree-state-tests --features " gix-features-parallel"
163
- cargo nextest run -p gix-worktree-tests --features " gix-features-parallel"
165
+ cargo nextest run -p gix-status-tests --features gix-features-parallel
166
+ cargo nextest run -p gix-worktree-state-tests --features gix-features-parallel
167
+ cargo nextest run -p gix-worktree-tests --features gix-features-parallel
164
168
cd gix-object; \
165
169
set -ex; \
166
170
cargo nextest run; \
@@ -172,10 +176,10 @@ unit-tests:
172
176
cargo nextest run -p gix-odb-tests --features gix-features-parallel
173
177
cargo nextest run -p gix-pack --all-features
174
178
cargo nextest run -p gix-pack-tests --features all-features
175
- cargo nextest run -p gix-pack-tests --features " gix-features-parallel"
176
- cargo nextest run -p gix-index-tests --features " gix-features-parallel"
179
+ cargo nextest run -p gix-pack-tests --features gix-features-parallel
180
+ cargo nextest run -p gix-index-tests --features gix-features-parallel
177
181
cargo nextest run -p gix-packetline --features blocking-io,maybe-async/ is_sync --test blocking-packetline
178
- cargo nextest run -p gix-packetline --features " async-io" --test async-packetline
182
+ cargo nextest run -p gix-packetline --features async-io --test async-packetline
179
183
cargo nextest run -p gix-transport --features http-client-curl,maybe-async/ is_sync
180
184
cargo nextest run -p gix-transport --features http-client-reqwest,maybe-async/ is_sync
181
185
cargo nextest run -p gix-transport --features async-client
@@ -191,75 +195,80 @@ unit-tests:
191
195
unit-tests-flaky :
192
196
cargo test -p gix --features async-network-client-async-std
193
197
194
- target_dir := ` cargo metadata --format-version 1 | jq -r .target_directory `
195
- ein := target_dir / " debug/ein"
196
- gix := target_dir / " debug/gix"
197
- jtt := target_dir / " debug/jtt"
198
- it := target_dir / " debug/it"
198
+ # Depend on this to pre-generate metadata, and/or use it inside a recipe as `"$({{ j }} dbg)"`
199
+ [private ]
200
+ dbg :
201
+ set -eu; \
202
+ target_dir=" $(cargo metadata --format-version 1 | jq -r .target_directory)" ; \
203
+ test -n " $target_dir" ; \
204
+ echo " $target_dir/debug"
199
205
200
- # run journey tests (max)
201
- journey-tests :
206
+ # Run journey tests (` max` )
207
+ journey-tests : dbg
202
208
cargo build --features http-client-curl-rustls
203
209
cargo build -p gix-testtools --bin jtt
204
- . / tests / journey.sh {{ ein }} {{ gix }} {{ jtt }} max
210
+ dbg= " $( {{ j }} dbg)" && tests / journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" max
205
211
206
- # run journey tests (max-pure)
207
- journey-tests-pure :
212
+ # Run journey tests (` max-pure` )
213
+ journey-tests-pure : dbg
208
214
cargo build --no-default-features --features max-pure
209
215
cargo build -p gix-testtools --bin jtt
210
- . / tests / journey.sh {{ ein }} {{ gix }} {{ jtt }} max-pure
216
+ dbg= " $( {{ j }} dbg)" && tests / journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" max-pure
211
217
212
- # run journey tests (small)
213
- journey-tests-small :
218
+ # Run journey tests (` small` )
219
+ journey-tests-small : dbg
214
220
cargo build --no-default-features --features small
215
221
cargo build -p gix-testtools
216
- . / tests / journey.sh {{ ein }} {{ gix }} {{ jtt }} small
222
+ dbg= " $( {{ j }} dbg)" && tests / journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" small
217
223
218
- # run journey tests (lean-async)
219
- journey-tests-async :
224
+ # Run journey tests (` lean-async` )
225
+ journey-tests-async : dbg
220
226
cargo build --no-default-features --features lean-async
221
227
cargo build -p gix-testtools
222
- . / tests / journey.sh {{ ein }} {{ gix }} {{ jtt }} async
228
+ dbg= " $( {{ j }} dbg)" && tests / journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" async
223
229
224
- # Run cargo- diet on all crates to see that they are still in bound
230
+ # Run ` cargo diet` on all crates to see that they are still in bounds
225
231
check-size :
226
- . / etc/ check-package-size.sh
232
+ etc/ check-package-size.sh
227
233
228
- # Check the minimal support rust version for currently installed Rust version
234
+ # Check the minimal support Rust version, with the currently installed Rust version
229
235
ci-check-msrv :
230
236
rustc --version
231
237
cargo check -p gix
232
238
cargo check -p gix --no-default-features --features async-network-client,max-performance
233
239
234
- # Enter a nix-shell able to build on macos
240
+ # Enter a nix-shell able to build on macOS
235
241
nix-shell-macos :
236
242
nix-shell -p pkg-config openssl libiconv darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration
237
243
238
- # run various auditing tools to assure we are legal and safe
244
+ # Run various auditing tools to help us stay legal and safe
239
245
audit :
240
246
cargo deny check advisories bans licenses sources
241
247
242
- # run tests with `cargo nextest` (all unit-tests, no doc-tests, faster)
243
- nextest * FLAGS = " --workspace" :
248
+ # Run tests with `cargo nextest` (all unit-tests, no doc-tests, faster)
249
+ nextest * FLAGS = ' --workspace' :
244
250
cargo nextest run {{ FLAGS }}
245
251
246
- summarize EXPRESSION = " all()": (nextest " --workspace --run-ignored all --no-fail-fast --status-level none --final-status-level none -E '" EXPRESSION " '" )
252
+ # Run tests with `cargo nextest`, skipping none except as filtered, omitting status reports
253
+ summarize EXPRESSION = ' all()':
254
+ cargo nextest run --workspace --run-ignored all --no-fail-fast \
255
+ - -status-level none --final-status-level none -E {{ quote (EXPRESSION) }}
247
256
248
- # run nightly rustfmt for its extra features, but check that it won't upset stable rustfmt
257
+ # Run nightly ` rustfmt` for its extra features, but check that it won't upset stable ` rustfmt`
249
258
fmt :
250
259
cargo + nightly fmt --all -- --config-path rustfmt-nightly.toml
251
260
cargo + stable fmt --all -- --check
252
- just --fmt --unstable
261
+ {{ j }} --fmt --unstable
253
262
254
- # Cancel this after the first few seconds, as yanked crates will appear in warnings.
263
+ # Cancel this after the first few seconds, as yanked crates will appear in warnings
255
264
find-yanked :
256
265
cargo install --debug --locked --no-default-features --features max-pure --path .
257
266
258
267
# Find shell scripts whose +x/-x bits and magic bytes (e.g. `#!`) disagree
259
268
check-mode :
260
269
cargo build -p internal-tools
261
- " {{ it }} " check-mode
270
+ cargo run -p internal-tools -- check-mode
262
271
263
- # Delete gix-packetline-blocking/src and regenerate from gix-packetline/src
272
+ # Delete ` gix-packetline-blocking/src` and regenerate from ` gix-packetline/src`
264
273
copy-packetline :
265
- . / etc/ copy-packetline.sh
274
+ etc/ copy-packetline.sh
0 commit comments