Skip to content

Commit 0a43f56

Browse files
committed
Suppress color in cargo tree warnings for simpler grepping
Without this, the `check` recipe in the `justfile` was failing on CI due to the change in the previous commit. On CI, we set `CARGO_TERM_COLOR` to `always`. The `--color` option takes precedence over the `CARGO_TERM_COLOR` environment variable. The suppresion is only done on those specific command whose stderr is being parsed. Other colorization remains allowed, including on CI. (An alternative to using `--color` here could be to make the `grep` pattern tolerate color codes where they may be present. But this would make the pattern considerably longer, more complicated, less less readable, and easier to get wrong.)
1 parent b8147f4 commit 0a43f56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

justfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ check:
5151
! cargo check -p gix-transport --all-features 2>/dev/null
5252
! cargo check -p gix-protocol --all-features 2>/dev/null
5353
# warning happens if nothing found, no exit code :/
54-
cargo tree -p gix --no-default-features -e normal -i imara-diff \
54+
cargo --color=never tree -p gix --no-default-features -e normal -i imara-diff \
5555
2>&1 >/dev/null | grep '^warning: nothing to print\>'
56-
cargo tree -p gix --no-default-features -e normal -i gix-submodule \
56+
cargo --color=never tree -p gix --no-default-features -e normal -i gix-submodule \
5757
2>&1 >/dev/null | grep '^warning: nothing to print\>'
58-
cargo tree -p gix --no-default-features -e normal -i gix-pathspec \
58+
cargo --color=never tree -p gix --no-default-features -e normal -i gix-pathspec \
5959
2>&1 >/dev/null | grep '^warning: nothing to print\>'
60-
cargo tree -p gix --no-default-features -e normal -i gix-filter \
60+
cargo --color=never tree -p gix --no-default-features -e normal -i gix-filter \
6161
2>&1 >/dev/null | grep '^warning: nothing to print\>'
6262
! cargo tree -p gix --no-default-features -i gix-credentials 2>/dev/null
6363
cargo check --no-default-features --features lean

0 commit comments

Comments
 (0)