From cd6825f2b6ca1417e63d6b921933a2b6d4d15c50 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Mon, 10 Jun 2024 15:05:04 +0900 Subject: [PATCH] Retire stable-rust clippy for still buggy redundant_clone (#1661) * Retire stable-rust clippy for buggy redundant_clone * Remove unused scripts/cargo-clippy-stable.sh * Remove clippy-stable from .mergify.yml --- .github/workflows/cargo.yml | 23 ----------------------- .mergify.yml | 10 +++------- programs/sbf/tests/programs.rs | 1 - scripts/cargo-clippy-nightly.sh | 3 +-- scripts/cargo-clippy-stable.sh | 31 ------------------------------- scripts/cargo-clippy.sh | 3 --- sdk/src/account.rs | 1 - 7 files changed, 4 insertions(+), 68 deletions(-) delete mode 100755 scripts/cargo-clippy-stable.sh diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 57c5944e22381a..e64852e42835e6 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -26,29 +26,6 @@ env: RUSTC_WRAPPER: "sccache" jobs: - clippy-stable: - strategy: - matrix: - os: - - macos-latest - - windows-latest - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - uses: mozilla-actions/sccache-action@v0.0.4 - with: - version: "v0.8.1" - - - shell: bash - run: .github/scripts/cargo-clippy-before-script.sh ${{ runner.os }} - - - shell: bash - run: | - source ci/rust-version.sh stable - rustup component add clippy --toolchain "$rust_stable" - scripts/cargo-clippy-stable.sh - clippy-nightly: strategy: matrix: diff --git a/.mergify.yml b/.mergify.yml index 19f9b8f116a78a..5cae9b59853f2f 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -60,13 +60,9 @@ pull_request_rules: - status-success=build & deploy docs - or: - -files~=(\.rs|Cargo\.toml|Cargo\.lock|\.github/scripts/cargo-clippy-before-script\.sh|\.github/workflows/cargo\.yml)$ - - and: - - or: - - check-success=clippy-stable (macos-latest) - - check-success=clippy-stable (macos-latest-large) - - or: - - check-success=clippy-nightly (macos-latest) - - check-success=clippy-nightly (macos-latest-large) + - or: + - check-success=clippy-nightly (macos-latest) + - check-success=clippy-nightly (macos-latest-large) - or: - -files~=(\.rs|Cargo\.toml|Cargo\.lock|cargo-build-bpf|cargo-test-bpf|cargo-build-sbf|cargo-test-sbf|ci/downstream-projects/run-spl\.sh|\.github/workflows/downstream-project-spl\.yml)$ - and: diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index 49e6b27a05f286..f4a3a6699a6600 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -1,7 +1,6 @@ #![cfg(any(feature = "sbf_c", feature = "sbf_rust"))] #![allow(clippy::clone_on_copy)] #![allow(clippy::needless_range_loop)] -#![allow(clippy::redundant_clone)] #![allow(clippy::needless_borrow)] #![allow(clippy::cmp_owned)] #![allow(clippy::match_like_matches_macro)] diff --git a/scripts/cargo-clippy-nightly.sh b/scripts/cargo-clippy-nightly.sh index 5393225542e2f6..12e0fc5b4ad0bb 100755 --- a/scripts/cargo-clippy-nightly.sh +++ b/scripts/cargo-clippy-nightly.sh @@ -29,5 +29,4 @@ source "$here/../ci/rust-version.sh" nightly --deny=clippy::default_trait_access \ --deny=clippy::arithmetic_side_effects \ --deny=clippy::manual_let_else \ - --deny=clippy::used_underscore_binding \ - --allow=clippy::redundant_clone + --deny=clippy::used_underscore_binding diff --git a/scripts/cargo-clippy-stable.sh b/scripts/cargo-clippy-stable.sh deleted file mode 100755 index ed564503e6ae2a..00000000000000 --- a/scripts/cargo-clippy-stable.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -here="$(dirname "$0")" -cargo="$(readlink -f "${here}/../cargo")" - -if [[ -z $cargo ]]; then - >&2 echo "Failed to find cargo. Mac readlink doesn't support -f. Consider switching - to gnu readlink with 'brew install coreutils' and then symlink greadlink as - /usr/local/bin/readlink." - exit 1 -fi - -# shellcheck source=ci/rust-version.sh -source "$here/../ci/rust-version.sh" stable - -# 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/solana-labs/solana/issues/31834 -# -# can't use --all-targets: -# error[E0554]: `#![feature]` may not be used on the stable release channel -"$here/cargo-for-all-lock-files.sh" -- \ - clippy \ - --workspace --tests --bins --examples --features dummy-for-ci-check -- \ - --deny=warnings \ - --deny=clippy::default_trait_access \ - --deny=clippy::arithmetic_side_effects \ - --deny=clippy::manual_let_else \ - --deny=clippy::used_underscore_binding diff --git a/scripts/cargo-clippy.sh b/scripts/cargo-clippy.sh index 2be51de54fb324..bfb4c7751633d4 100755 --- a/scripts/cargo-clippy.sh +++ b/scripts/cargo-clippy.sh @@ -15,8 +15,5 @@ set -o errexit here="$(dirname "$0")" -# stable -"$here/cargo-clippy-stable.sh" - # nightly "$here/cargo-clippy-nightly.sh" diff --git a/sdk/src/account.rs b/sdk/src/account.rs index 291b0bcb31f1c7..c0f3d783c14038 100644 --- a/sdk/src/account.rs +++ b/sdk/src/account.rs @@ -1011,7 +1011,6 @@ pub mod tests { } #[test] - #[allow(clippy::redundant_clone)] fn test_account_shared_data_all_fields() { let key = Pubkey::new_unique(); let key2 = Pubkey::new_unique();