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

Clippy tests #122

Merged
merged 6 commits into from
Aug 8, 2019
Merged

Clippy tests #122

merged 6 commits into from
Aug 8, 2019

Conversation

martinthomson
Copy link
Member

VS Code runs clippy on tests. I don't know how to do that from the command line (or else I would change our CI setup as well), but these are the problems I found and fixed.

The only thing I didn't fix were a couple of functions that were past the cognitive complexity limit.

Not sure how this can be done from the command-line, but VS Code brings all these up.
if client {
hconn = Http3Connection::new(default_client(), 100, 100, None);
neqo_trans_conn = default_server();
let (mut hconn, mut neqo_trans_conn) = if client {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like how clippy warns about this one. But I'm not in a mood to suppress the change, even if it isn't great.

@@ -1332,16 +1333,14 @@ mod tests {
let events = neqo_trans_conn.events();
let mut stop_sending_event_found = false;
for e in events {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a common pattern. I was uncertain about whether to change this to use Iterator::any, which would be better for looking for the event. But that would be lots of typing.

@o0Ignition0o
Copy link
Collaborator

I don't know how to do that from the command line (or else I would change our CI setup as well)

it seems cargo clippy --tests does the trick :)

@martinthomson
Copy link
Member Author

it seems cargo clippy --tests does the trick :)

I went with something a little broader than that. cargo clippy --all-features --all-targets gets more than just the one set of configs. Gee it would be nice if --help actually listed these things.

@martinthomson
Copy link
Member Author

Gee it would be nice if --help actually listed these things.

Oh, it does:

Other options are the same as `cargo check`.

agrover
agrover previously approved these changes Aug 8, 2019
Copy link
Contributor

@agrover agrover left a comment

Choose a reason for hiding this comment

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

😮

👍

@mergify mergify bot dismissed agrover’s stale review August 8, 2019 11:09

Pull request has been modified.

@mergify mergify bot merged commit f36f044 into master Aug 8, 2019
@mergify mergify bot deleted the clippy-tests branch August 8, 2019 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants