cargo-clippy-nightly.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. set -o errexit
  3. here="$(dirname "$0")"
  4. cargo="$(readlink -f "${here}/../cargo")"
  5. if [[ -z $cargo ]]; then
  6. echo >&2 "Failed to find cargo. Mac readlink doesn't support -f. Consider switching
  7. to gnu readlink with 'brew install coreutils' and then symlink greadlink as
  8. /usr/local/bin/readlink."
  9. exit 1
  10. fi
  11. # shellcheck source=ci/rust-version.sh
  12. source "$here/../ci/rust-version.sh" nightly
  13. # Use nightly clippy, as frozen-abi proc-macro generates a lot of code across
  14. # various crates in this whole monorepo (frozen-abi is enabled only under nightly
  15. # due to the use of unstable rust feature). Likewise, frozen-abi(-macro) crates'
  16. # unit tests are only compiled under nightly.
  17. # Similarly, nightly is desired to run clippy over all of bench files because
  18. # the bench itself isn't stabilized yet...
  19. # ref: https://github.com/rust-lang/rust/issues/66287
  20. "$here/cargo-for-all-lock-files.sh" -- \
  21. "+${rust_nightly}" clippy \
  22. --workspace --all-targets --features dummy-for-ci-check,frozen-abi -- \
  23. --deny=warnings \
  24. --deny=clippy::default_trait_access \
  25. --deny=clippy::arithmetic_side_effects \
  26. --deny=clippy::manual_let_else \
  27. --deny=clippy::uninlined-format-args \
  28. --deny=clippy::used_underscore_binding