Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain use of nightly clippy over whole monorepo #9

Open
wants to merge 4 commits into
base: test-checks-sh-indent
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions ci/test-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,27 @@ else
echo "Note: cargo-for-all-lock-files.sh skipped because $CI_BASE_BRANCH != $EDGE_CHANNEL"
fi

_ ci/order-crates-for-publishing.py
_ ci/order-crates-for-publishing.py

nightly_clippy_allows=(--allow=clippy::redundant_clone)

# run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there
_ scripts/cargo-for-all-lock-files.sh -- "+${rust_nightly}" clippy --workspace --all-targets --features dummy-for-ci-check -- \
--deny=warnings \
--deny=clippy::default_trait_access \
--deny=clippy::integer_arithmetic \
--deny=clippy::used_underscore_binding \
"${nightly_clippy_allows[@]}"
# Use nightly clippy, as frozen-abi proc-macro generates a lot of code across
# various crates in this whole monorepo (frozen-abi is enabled only under nightly
# due to the use of unstable rust feature). Likewise, frozen-abi(-macro) crates'
# unit tests are only compiled under nightly.
# Similarly, nightly is desired to run clippy over all of bench files because
# the bench itself isn't stabilized yet...
# ref: https://github.com/rust-lang/rust/issues/66287
_ scripts/cargo-for-all-lock-files.sh -- "+${rust_nightly}" clippy --workspace --all-targets --features dummy-for-ci-check -- \
--deny=warnings \
--deny=clippy::default_trait_access \
--deny=clippy::integer_arithmetic \
--deny=clippy::used_underscore_binding \
"${nightly_clippy_allows[@]}"

# temporarily run stable clippy as well to scan the codebase for
# `redundant_clone`s, which is disabled as nightly clippy is buggy:
# https://github.com/rust-lang/rust-clippy/issues/10577
# https://github.com/solana-labs/solana/issues/31834
#
# can't use --all-targets:
# error[E0554]: `#![feature]` may not be used on the stable release channel
Expand All @@ -106,6 +112,6 @@ fi

_ scripts/cargo-for-all-lock-files.sh -- "+${rust_nightly}" fmt --all -- --check

_ ci/do-audit.sh
_ ci/do-audit.sh

echo --- ok