-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix: clippy gh action and linting #531
Conversation
@@ -60,6 +60,7 @@ impl<Ctx: Context> MpcAesGcm<Ctx> { | |||
} | |||
|
|||
#[async_trait] | |||
#[allow(clippy::blocks_in_conditions)] |
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.
this needs to be declared due to this upstream issue rust-lang/rust-clippy#12281 — we shall file a ticket to remove this declaration once the upstream fix is released
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.
gw!
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.
lgtm, just 1 issue
if server_closed && client.plaintext_is_empty() && client.buffer_len().await? == 0 { | ||
break 'conn; |
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.
we don't want to create the client.buffer_len()
future unless the first two conditions are met.
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.
I think Rust short-circuits https://stackoverflow.com/questions/53644809/do-logical-operators-short-circuit-in-rust
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.
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.
lgtm, just 1 change
.github/workflows/ci.yml
Outdated
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 simpler solution to this is to just add #[allow(clippy::all)]
at in the lib.rs
of the tls client crate
@@ -89,6 +89,7 @@ impl<C, Ctx> Debug for Ghash<C, Ctx> { | |||
} | |||
|
|||
#[async_trait] | |||
#[allow(clippy::blocks_in_conditions)] |
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.
Is this lint here needed? I remember that this was/is some sort of clippy bug.
#373 introduced a change that caused GH
clippy
action to only run on examples folder but not anything else (can check the past CI logs, e.g. https://github.com/tlsnotary/tlsn/actions/runs/9755990843/job/26925478536)).This PR fixes that by running
clippy
on all targets (binary, library, example, test, bench). Though since thecomponents/tls/tls-client
crate contains broken tests that don't compile, cargo hack is used temporarily to exclude the crate when runningclippy
in thecomponents/tls
workspace until the test is fixed.Linting changes from applying
clippy
on the entire codebase are included too.