arcnmx / cargo-clippy

cargo clippy
MIT License
68 stars 11 forks source link

consider passing `--cfg test` by default #12

Open durka opened 8 years ago

durka commented 8 years ago

Regular cargo clippy doesn't check #[test] functions because it can't (the code is gone by the time the lints run). But if you do cargo clippy -- --cfg test it works. I wonder if there are any downsides to making this the default behavior.

durka commented 8 years ago

I guess this breaks people who have #[cfg(not(test))] on things. But perhaps cargo-clippy can support a --test flag which would be a bit shorter than -- --cfg test.