2021-02-21 16:08:08 +00:00
|
|
|
#!/bin/bash
|
2021-04-28 06:09:11 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
_extra=""
|
|
|
|
if [ "$1" == "ci" ]; then
|
|
|
|
# deny on warnings when running in CI
|
|
|
|
_extra="-Dwarnings"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# allow find to fail
|
|
|
|
find . -name '*.rs' -exec touch "{}" \; || true
|
|
|
|
|
2021-04-27 10:25:41 +00:00
|
|
|
cargo clippy --all-features --tests -- \
|
2021-02-21 16:08:08 +00:00
|
|
|
-W clippy::nursery \
|
|
|
|
-W clippy::perf \
|
|
|
|
-W clippy::pedantic \
|
|
|
|
-W clippy::complexity \
|
|
|
|
-W clippy::cargo \
|
2021-04-02 17:51:49 +00:00
|
|
|
-W clippy::float_cmp_const \
|
|
|
|
-W clippy::lossy_float_literal \
|
|
|
|
-W clippy::multiple_inherent_impl \
|
|
|
|
-W clippy::string_to_string \
|
|
|
|
-W clippy::wrong_pub_self_convention \
|
2021-02-21 16:08:08 +00:00
|
|
|
-A clippy::unused_io_amount \
|
|
|
|
-A clippy::redundant_closure_for_method_calls \
|
2021-04-04 13:52:16 +00:00
|
|
|
-A clippy::shadow_unrelated \
|
2021-04-28 06:09:11 +00:00
|
|
|
-A clippy::option_if_let_else \
|
|
|
|
"$_extra"
|
2021-02-21 16:08:08 +00:00
|
|
|
|
|
|
|
# ALLOWS:
|
|
|
|
# unused_io_amount: there are two places where i want to read up to X bytes and i'm fine with getting less than that
|
|
|
|
# redundant_closure...: the alternative is often much more verbose
|
|
|
|
# shadow_unrelated: sometimes things that seem unrelated are actually related ;)
|
2021-04-04 13:52:16 +00:00
|
|
|
# option_if_let_else: the suggested code is usually harder to read than the original
|
2021-02-21 16:08:08 +00:00
|
|
|
|