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

problem: CI doesn't cover all cases #208

Closed
ghost opened this issue Apr 7, 2019 · 4 comments · Fixed by #303
Closed

problem: CI doesn't cover all cases #208

ghost opened this issue Apr 7, 2019 · 4 comments · Fixed by #303
Labels
Bug Recognized misbehavior. Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help.

Comments

@ghost
Copy link

ghost commented Apr 7, 2019

Was introduced by #190:

Was before:

    before_script:
      - cargo fmt --all -- --check
      - cargo clippy --all -- -D clippy

Became:

  - if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo fmt -- --check; fi
  - if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy -- -D clippy::all; fi

Steps to reproduce:

  • Run cargo fmt --all -- --check

What expected:

  • Ok, while CI is ok

What was recieved:

  • Error, because in CI fmt checks not all features
Diff in \\?\D:\Projects\raft-rs\harness\src\network.rs at line 27:

 use super::interface::Interface;
 use raft::{
-    eraftpb::{Message, MessageType, ConfState},
+    eraftpb::{ConfState, Message, MessageType},
     storage::MemStorage,
     Config, Raft, Result, NO_LIMIT,
 };
@ghost
Copy link
Author

ghost commented Apr 7, 2019

May be it will be helpful to extand clippy to also check tests and non-default crate features with cargo clippy --all-targets --all-features:

    Checking raft v0.5.0 (D:\Projects\raft-rs)
error: this .into_iter() call is equivalent to .iter() and will not move the Vec
    --> src\raft_log.rs:1341:37
     |
1341 |             for (j, idx) in compact.into_iter().enumerate() {
     |                                     ^^^^^^^^^ help: call directly: `iter`
     |
note: lint level defined here
    --> src\lib.rs:370:9
     |
370  | #![deny(clippy::all)]
     |         ^^^^^^^^^^^
     = note: #[deny(clippy::into_iter_on_ref)] implied by #[deny(clippy::all)]
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref

error: aborting due to previous error

error: Could not compile `raft`.

@Hoverbear Hoverbear added Bug Recognized misbehavior. Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help. labels Apr 29, 2019
@Hoverbear
Copy link
Contributor

Great catch! Would you be interested in making a PR?

@psinghal20
Copy link
Contributor

Hi @Hoverbear, I raised a PR for this issue covering all the cases and targets for rustfmt and clippy. I didn't turn on the all-features flag as the protobuf-codec and prost-codec were conflicting with each other. PTAL.

@Hoverbear
Copy link
Contributor

You are so awesome 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Recognized misbehavior. Good First Issue A good issue for a new contributor. Help Wanted An issue with unsolved problems, looking for help.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants