Adding cargo checking to husky pre-commit. Fixes #402
This commit is contained in:
parent
bd99f4994a
commit
2d95db8a7d
2 changed files with 7 additions and 4 deletions
|
@ -408,7 +408,7 @@ mod tests {
|
||||||
user_id: Some(inserted_user.id),
|
user_id: Some(inserted_user.id),
|
||||||
my_vote: Some(1),
|
my_vote: Some(1),
|
||||||
id: inserted_post.id,
|
id: inserted_post.id,
|
||||||
name: post_name.to_owned(),
|
name: post_name,
|
||||||
url: None,
|
url: None,
|
||||||
body: None,
|
body: None,
|
||||||
removed: false,
|
removed: false,
|
||||||
|
@ -416,12 +416,12 @@ mod tests {
|
||||||
locked: false,
|
locked: false,
|
||||||
stickied: false,
|
stickied: false,
|
||||||
creator_id: inserted_user.id,
|
creator_id: inserted_user.id,
|
||||||
creator_name: user_name.to_owned(),
|
creator_name: user_name,
|
||||||
creator_avatar: None,
|
creator_avatar: None,
|
||||||
banned: false,
|
banned: false,
|
||||||
banned_from_community: false,
|
banned_from_community: false,
|
||||||
community_id: inserted_community.id,
|
community_id: inserted_community.id,
|
||||||
community_name: community_name.to_owned(),
|
community_name,
|
||||||
community_removed: false,
|
community_removed: false,
|
||||||
community_deleted: false,
|
community_deleted: false,
|
||||||
community_nsfw: false,
|
community_nsfw: false,
|
||||||
|
|
5
ui/package.json
vendored
5
ui/package.json
vendored
|
@ -58,7 +58,7 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"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": {
|
"lint-staged": {
|
||||||
|
@ -67,6 +67,9 @@
|
||||||
"eslint --fix",
|
"eslint --fix",
|
||||||
"git add"
|
"git add"
|
||||||
],
|
],
|
||||||
|
"../server/src/**/*.rs": [
|
||||||
|
"git add"
|
||||||
|
],
|
||||||
"package.json": [
|
"package.json": [
|
||||||
"sortpack",
|
"sortpack",
|
||||||
"git add"
|
"git add"
|
||||||
|
|
Reference in a new issue