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

Add clippy to ci and fix warnings #85

Merged
merged 5 commits into from
Aug 19, 2020
Merged

Add clippy to ci and fix warnings #85

merged 5 commits into from
Aug 19, 2020

Conversation

iffyio
Copy link
Collaborator

@iffyio iffyio commented Aug 15, 2020

Fixes #82

Copy link
Collaborator Author

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Added context for the less obvious diffs

src/extensions/filter_registry.rs Show resolved Hide resolved
src/server/mod.rs Outdated Show resolved Hide resolved
src/server/sessions/session.rs Show resolved Hide resolved
src/extensions/filter_registry.rs Show resolved Hide resolved
@iffyio
Copy link
Collaborator Author

iffyio commented Aug 15, 2020

@markmandel could you take a look at why the build fails in ci I don't have viewing permissions 😊

@markmandel
Copy link
Member

Already have image (with digest): gcr.io/quilkin/ci
error: 'cargo-clippy' is not installed for the toolchain '1.42.0-x86_64-unknown-linux-gnu'
To install, run `rustup component add clippy --toolchain 1.42.0-x86_64-unknown-linux-gnu`

And added you as viewer! When we are ready for this to go open, I'll set it up so that the build results are more public.

@markmandel
Copy link
Member

Sounds like we would want to add clippy here:
https://github.com/googleforgames/quilkin/blob/master/ci/Dockerfile

Then I can rebuild the ci image and push it up 👍

@iffyio
Copy link
Collaborator Author

iffyio commented Aug 17, 2020

Updated dockerfile.

@markmandel
Copy link
Member

And rebuilt. Let's try it again!

@markmandel
Copy link
Member

That looks better:

error: You matched a field with a wildcard pattern. Consider using `..` instead
   --> src/config.rs:156:17
    |
156 |                 connection_id: _,
    |                 ^^^^^^^^^^^^^^^^
    |
note: lint level defined here
   --> src/lib.rs:17:9
    |
17  | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(clippy::unneeded_field_pattern)]` implied by `#[deny(warnings)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern

error: You matched a field with a wildcard pattern. Consider using `..` instead
   --> src/config.rs:157:17
    |
157 |                 lb_policy: _,
    |                 ^^^^^^^^^^^^
    |
    = help: Try with `Client { addresses, .. }`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern

error: aborting due to 2 previous errors

error: could not compile `quilkin`.

To learn more, run the command again with --verbose.

We are getting Clippy warnings now!

@markmandel
Copy link
Member

Looks like there is a bug with Cloud Build integration where it only points to the first build. If you go to the build history, you can see the latest version.

(I've filed a bug)

@markmandel
Copy link
Member

I'm not seeing those warnings locally - wondering if we should also update our rust version at the same time?

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Nice changes. Had a few questions along the way, but overall 👍

src/extensions/filter_chain.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/server/mod.rs Outdated Show resolved Hide resolved
@markmandel
Copy link
Member

@markmandel
Copy link
Member

Got a test failure :( Can repro it locally too.

---- config::tests::parse_server stdout ----
thread 'config::tests::parse_server' panicked at 'called `Result::unwrap()` on an `Err` value: Message("no variant of enum ConnectionConfig found in flattened data", Some(Pos { marker: Marker { index: 10, line: 3, col: 5 }, path: "." }))', src/config.rs:307:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    config::tests::parse_server

test result: FAILED. 40 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

👍

@markmandel markmandel merged commit cb3af29 into master Aug 19, 2020
@markmandel markmandel deleted the iu/clippy branch August 19, 2020 16:51
@markmandel markmandel added the kind/cleanup Refactoring code, fixing up documentation, etc label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes kind/cleanup Refactoring code, fixing up documentation, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add clippy to ci
3 participants