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

[Merged by Bors] - Address clippy lints, panic in ssz_derive on overflow #1714

Closed
wants to merge 5 commits into from

Conversation

paulhauner
Copy link
Member

Issue Addressed

NA

Proposed Changes

  • Panic or return error if we overflow usize in SSZ decoding/encoding derive macros.
    • I claim that the panics can only be triggered by a faulty type definition in lighthouse, they cannot be triggered externally on a validly defined struct.
  • Use Ordering instead of some if statements, as demanded by clippy.
  • Remove some old clippy allow that seem to no longer be required.
  • Add comments to interesting clippy statements that we're going to continue to ignore.
  • Create Large enum variant in store #1713

Additional Info

NA

@paulhauner paulhauner added ready-for-review The code is ready for review A0 labels Oct 3, 2020
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this, but a lot of the deleted lints are only deleted because we've accidentally stopped linting our tests and benchmarks. This may be desirable (because Clippy can be burdensome), or not, I'm not really convinced either way.

If we did want to lint everything, I think we'd want this command:

cargo clippy --workspace --all-targets -- -D warnings

(we use --all at the moment instead of --workspace, but --all is deprecated)

@paulhauner paulhauner added A1 and removed A0 labels Oct 5, 2020
Base automatically changed from v0.3.0-staging to master October 9, 2020 06:08
@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 12, 2020
@paulhauner
Copy link
Member Author

a lot of the deleted lints are only deleted because we've accidentally stopped linting our tests and benchmarks.

Thanks for pointing this out! I've removed such cases.

If we did want to lint everything,

I tried doing this, but it became tedious so I gave up. Perhaps we can come back to it.

@paulhauner paulhauner added ready-for-review The code is ready for review and removed t Consensus & Verification labels Oct 23, 2020
@paulhauner paulhauner removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Oct 25, 2020
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

bors r+

bors bot pushed a commit that referenced this pull request Oct 25, 2020
## Issue Addressed

NA

## Proposed Changes

- Panic or return error if we overflow `usize` in SSZ decoding/encoding derive macros.
  - I claim that the panics can only be triggered by a faulty type definition in lighthouse, they cannot be triggered externally on a validly defined struct.
- Use `Ordering` instead of some `if` statements, as demanded by clippy.
- Remove some old clippy `allow` that seem to no longer be required.
- Add comments to interesting clippy statements that we're going to continue to ignore.
- Create #1713

## Additional Info

NA
@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Oct 25, 2020
@bors bors bot changed the title Address clippy lints, panic in ssz_derive on overflow [Merged by Bors] - Address clippy lints, panic in ssz_derive on overflow Oct 26, 2020
@bors bors bot closed this Oct 26, 2020
@michaelsproul michaelsproul deleted the clippy-tidy branch October 26, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants