You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Solana repository contains multiple workspaces, but Clippy is run only on the top-level workspace. This could cause important bugs to be missed.
The line in ci/test-checks.sh that runs Clippy appears in figure 13.1. A potential modification to run it on all workspaces appears in
figure 13.2. Running the modified command produces additional warnings. An example appears in figure 13.3.
Figure 13.2: Potential modification to the command in figure 13.1
error: integer arithmetic detected
--> rust/realloc/src/instructions.rs:22:5
|
22 | *bump += 1;
| ^^^^^^^^^^
|
= note: requested on the command line with `-D clippy::integer-arithmetic`
= help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
Figure 13.3: Example warning produced when the command in figure 13.2 is run
Proposed Solution
Short term, ensure that Clippy is run on all workspaces in CI. Clippy is an invaluable tool for exposing bugs and problematic coding patterns. Running it on all workspaces will improve Clippy’s effectiveness at exposing bugs in Solana.
Long term, when problematic code patterns are discovered, check whether they are caught by an existing Clippy lint. Doing so will help to verify that Clippy is being run on all code for which it is intended.
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.
Problem
The Solana repository contains multiple workspaces, but Clippy is run only on the top-level workspace. This could cause important bugs to be missed.
The line in ci/test-checks.sh that runs Clippy appears in figure 13.1. A potential modification to run it on all workspaces appears in
figure 13.2. Running the modified command produces additional warnings. An example appears in figure 13.3.
Figure 13.1: solana/ci/test-checks.sh#L70
Figure 13.2: Potential modification to the command in figure 13.1
Figure 13.3: Example warning produced when the command in figure 13.2 is run
Proposed Solution
Short term, ensure that Clippy is run on all workspaces in CI. Clippy is an invaluable tool for exposing bugs and problematic coding patterns. Running it on all workspaces will improve Clippy’s effectiveness at exposing bugs in Solana.
Long term, when problematic code patterns are discovered, check whether they are caught by an existing Clippy lint. Doing so will help to verify that Clippy is being run on all code for which it is intended.
The text was updated successfully, but these errors were encountered: