Heya! I have now run several times into the situation where I run cargo check
and have everything checks fine, only to have cargo test
then fail to compile because I forgot to adjust the tests.
This is in theory easy to fix, cargo test --tests
or cargo test --all-targets
would make sure those are also checked. But this is longer to type, and easy to forget. I could of course make an alias in my shell, write my own shellscript or any other external solution. But I am interested in the possibility of selecting which targets to check via configuration of cargo check?
I did not find anything that points towards this being possible right now, so my question would be, is this something that had been discussed? I tried looking but didn't find anything (cargo
, check
and configuration
are not very low entropy words).
I could see this work mostly with an environment variable: CARGO_CHECK_TARGETS
which takes similar values as the CLI: CARGO_CHECK_TARGETS=tests,bench=foo*,
etc...
I would then set this as part of my dev environment and could share it with my colleagues for example. (How I would do that is out of scope here of course)