From 206d9160de7f1289a16b56e418afaef80a9cb7df Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 4 Jan 2020 17:21:33 -0500 Subject: [PATCH] Adding cargo checking to husky pre-commit. Fixes #402 --- server/src/db/post_view.rs | 6 +++--- ui/package.json | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/src/db/post_view.rs b/server/src/db/post_view.rs index f0638eb53..0efcab43e 100644 --- a/server/src/db/post_view.rs +++ b/server/src/db/post_view.rs @@ -408,7 +408,7 @@ mod tests { user_id: Some(inserted_user.id), my_vote: Some(1), id: inserted_post.id, - name: post_name.to_owned(), + name: post_name, url: None, body: None, removed: false, @@ -416,12 +416,12 @@ mod tests { locked: false, stickied: false, creator_id: inserted_user.id, - creator_name: user_name.to_owned(), + creator_name: user_name, creator_avatar: None, banned: false, banned_from_community: false, community_id: inserted_community.id, - community_name: community_name.to_owned(), + community_name, community_removed: false, community_deleted: false, community_nsfw: false, diff --git a/ui/package.json b/ui/package.json index f816b4f62..afcb8a39b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -58,7 +58,7 @@ "engineStrict": true, "husky": { "hooks": { - "pre-commit": "lint-staged" + "pre-commit": "cargo fmt --manifest-path ../server/Cargo.toml && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && lint-staged" } }, "lint-staged": { @@ -67,6 +67,9 @@ "eslint --fix", "git add" ], + "../server/src/**/*.rs": [ + "git add" + ], "package.json": [ "sortpack", "git add"