]> Untitled Git - lemmy.git/commitdiff
Adding cargo checking to husky pre-commit. Fixes #402
authorDessalines <tyhou13@gmx.com>
Sat, 4 Jan 2020 22:21:33 +0000 (17:21 -0500)
committerDessalines <tyhou13@gmx.com>
Sat, 4 Jan 2020 22:21:33 +0000 (17:21 -0500)
server/src/db/post_view.rs
ui/package.json

index f0638eb530b9a78fc1c19ede4f22a225d173e93a..0efcab43e59fbc5e753a4104e5bdcaad5e5cc73b 100644 (file)
@@ -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,
index f816b4f6218fde9c325b230827504c75404ca128..afcb8a39ba6eb7da4b8fc4e6437a67c7798a9b3a 100644 (file)
@@ -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"