@@ -15,7 +15,17 @@ _rustflags := env_var_or_default("RUSTFLAGS", "")
15
15
16
16
# If we're running in Github Actions and cargo-action-fmt is installed, then add
17
17
# a command suffix that formats errors.
18
- _fmt := if env_var_or_default (" GITHUB_ACTIONS" , " " ) != " true" { " " } else {
18
+ #
19
+ # Clippy version also gets -Dwarnings.
20
+ _fmt_clippy := if env_var_or_default (" GITHUB_ACTIONS" , " " ) != " true" { " -- -Dwarnings" } else {
21
+ ```
22
+ if command -v cargo-action-fmt > /dev/null 2>&1 ; then
23
+ echo " --message-format=json -- -Dwarnings | cargo-action-fmt"
24
+ fi
25
+ ```
26
+ }
27
+
28
+ _fmt_check_doc := if env_var_or_default (" GITHUB_ACTIONS" , " " ) != " true" { " " } else {
19
29
```
20
30
if command -v cargo-action-fmt > /dev/null 2>&1 ; then
21
31
echo " --message-format=json | cargo-action-fmt"
@@ -47,27 +57,28 @@ default:
47
57
check : && (check-crate _d1_pkg) (check-crate _espbuddy_pkg) (check-crate _x86 _bootloader_pkg)
48
58
{{ _cargo }} check \
49
59
- -lib --bins --examples --tests --benches \
50
- {{ _fmt }}
60
+ {{ _fmt_check_doc }}
51
61
52
62
# check a crate.
53
63
check-crate crate :
54
64
{{ _cargo }} check \
55
65
- -lib --bins --examples --tests --benches --all-features \
56
66
- -package {{ crate }} \
57
- {{ _fmt }}
67
+ {{ _fmt_check_doc }}
58
68
59
69
# run Clippy checks for all crates, across workspaces.
60
70
clippy : && (clippy-crate _d1_pkg) (clippy-crate _espbuddy_pkg) (clippy-crate _x86 _bootloader_pkg)
61
71
{{ _cargo }} clippy \
62
72
- -lib --bins --examples --tests --benches --all-features \
63
- {{ _fmt }}
73
+ {{ _fmt_clippy }}
64
74
65
75
# run clippy checks for a crate.
76
+ # NOTE: -Dwarnings is added by _fmt because reasons
66
77
clippy-crate crate :
67
78
{{ _cargo }} clippy \
68
79
- -lib --bins --examples --tests --benches \
69
80
- -package {{ crate }} \
70
- {{ _fmt }}
81
+ {{ _fmt_clippy }}
71
82
72
83
# test all packages, across workspaces
73
84
test : (_get-cargo-command " nextest" " cargo-nextest" no-nextest)
@@ -138,7 +149,7 @@ docs *FLAGS:
138
149
{{ _cargo }} doc \
139
150
- -all-features \
140
151
{{ FLAGS }} \
141
- {{ _fmt }}
152
+ {{ _fmt_check_doc }}
142
153
143
154
_ get-cargo-command name pkg skip = ' ':
144
155
#!/usr/bin/env bash
@@ -158,4 +169,4 @@ _get-cargo-command name pkg skip='':
158
169
err " missing cargo-{{ name }} executable"
159
170
if confirm " install it?" ; then
160
171
cargo install {{ pkg }}
161
- fi
172
+ fi
0 commit comments