-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcargo-rustdoc-clippy
More file actions
executable file
·54 lines (45 loc) · 928 Bytes
/
Copy pathcargo-rustdoc-clippy
File metadata and controls
executable file
·54 lines (45 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/zsh
set -eu
if [[ $# -gt 0 && "$1" = "rustdoc-clippy" ]]
then
shift
if [[ $# -gt 0 && "$1" = "--help" ]]
then
echo "USAGE: cargo rustdoc-clippy [cargo-options] [-- [rustdoc-options] [-- [clippy-options]]]"
exit
fi
cargo_args=()
while [[ $# -gt 0 && "$1" != "--" ]]
do
cargo_args+="$1"
shift
done
if [[ $# -gt 0 ]]
then
shift
fi
rustdoc_args=()
while [[ $# -gt 0 && "$1" != "--" ]]
do
rustdoc_args+="$1"
shift
done
if [[ $# -gt 0 ]]
then
shift
fi
clippy_args=()
while [[ $# -gt 0 ]]
do
clippy_args+="$1"
shift
done
CLIPPYFLAGS="${(j:\x1E:)clippy_args}" RUSTDOCFLAGS="--no-run --nocapture --test-builder "$0" -Z unstable-options $rustdoc_args[@]" exec cargo test --doc "$cargo_args[@]"
else
if [[ "$CLIPPYFLAGS" != "" ]]
then
exec clippy-driver "${(@s:\x1E:)CLIPPYFLAGS}" "$@"
else
exec clippy-driver "$@"
fi
fi