-
Notifications
You must be signed in to change notification settings - Fork 632
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
feat: enable clippy::correctness as part of CI #8299
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pugachAG
force-pushed
the
enable-clippy
branch
from
January 10, 2023 09:59
ee82d2f
to
d67e30c
Compare
pugachAG
force-pushed
the
enable-clippy
branch
from
January 10, 2023 10:02
d67e30c
to
5496f34
Compare
pugachAG
changed the title
wip: enable clippy as part of CI
feat: enable clippy::correctness as part of CI
Jan 10, 2023
nagisa
reviewed
Jan 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clippy file has been added empty, so we should probably not add one at all.
nagisa
approved these changes
Jan 10, 2023
pugachAG
added
A-CI
Area: Continuous Integration
A-benchmark
Area: performance benchmarks
S-automerge
and removed
A-benchmark
Area: performance benchmarks
labels
Jan 11, 2023
nikurt
pushed a commit
to nikurt/nearcore
that referenced
this pull request
Jan 15, 2023
This enables clippy `clippy::correctness` checks as part of CI as discussed [here](near#8291 (comment)). It is added as part of `sanity check` step for consistency, since that is where `cargo check` is executed. This fixes the following issues in order to pass the added checks: * noop `.clone()` * this loop never actually loops * `0` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `self.burst == 0` instead This PR is a part of near#8145
near-bulldozer bot
pushed a commit
that referenced
this pull request
Jan 16, 2023
`block_refcount_final` was incorrectly refactored in #8299 to check for `sv.inner.genesis_blocks` and `sv.inner.block_refcount` being non-empty. It should check for more than 1 element instead. This was caught by [the nayduck test](https://nayduck.near.org/#/test/410756): ``` 2023-01-15T12:31:09.117757Z ERROR handle{handler="NetworkAdversarialMessage" actor="ClientActor" msg_type="NetworkAdversarialMessage"}: client: Storage Validation failed, [ErrorMessage { col: "BlockRefCount", key: "\"BLOCK_REFCOUNT\"", err: ValidationFailed { func_name: "f", error: "Found 1 Blocks that are not counted, e.g. (B7Sbqj2uD5M3yACTDgSDG9haw2L5vEdLsJiosuPZCDn1, 1)" } }] ``` See [zulip thread](https://near.zulipchat.com/#narrow/stream/295302-general/topic/failing.20nayduck.20tests) for more context.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables clippy
clippy::correctness
checks as part of CI as discussed here.It is added as part of
sanity check
step for consistency, since that is wherecargo check
is executed.This fixes the following issues in order to pass the added checks:
.clone()
0
is the minimum value for this type, the case where the two sides are not equal never occurs, consider usingself.burst == 0
insteadThis PR is a part of #8145