Skip to content

Commit

Permalink
Run clippy first in CI (#100)
Browse files Browse the repository at this point in the history
* Run clippy first in CI
* Fix clippy warnings
  • Loading branch information
iffyio authored Sep 8, 2020
1 parent 2d8f07d commit c23ceac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@
# limitations under the License.

steps:
# clippy tends to rely on cached results from other cargo sub-commands so
# that it skips checking some files that were built previously. As a result
# we run it before other cargo sub-commands to ensure that it checks all files.
- name: gcr.io/$PROJECT_ID/ci
args: ["clippy"]
id: clippy
- name: gcr.io/$PROJECT_ID/ci
args: ["check", "--tests"]
id: check-tests
- name: gcr.io/$PROJECT_ID/ci
args: ["fmt", "--", "--check"]
id: fmt-check
- name: gcr.io/$PROJECT_ID/ci
args: ["clippy"]
id: clippy
- name: gcr.io/$PROJECT_ID/ci
args: ["test", "--tests"]
id: test
Expand Down
4 changes: 2 additions & 2 deletions src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ where
let contents = "hello".to_string().into_bytes();

match filter.on_downstream_receive(&endpoints, from, contents.clone()) {
None => assert!(false, "should return a result"),
None => unreachable!("should return a result"),
Some((result_endpoints, result_contents)) => {
assert_eq!(endpoints, result_endpoints);
assert_eq!(contents, result_contents);
Expand All @@ -220,7 +220,7 @@ where
"127.0.0.1:70".parse().unwrap(),
contents.clone(),
) {
None => assert!(false, "should return a result"),
None => unreachable!("should return a result"),
Some(result_contents) => assert_eq!(contents, result_contents),
}
}
Expand Down

0 comments on commit c23ceac

Please sign in to comment.