+6
-1
@@ -9,7 +9,12 @@
|
|||||||
"rust-analyzer": {
|
"rust-analyzer": {
|
||||||
"initialization_options": {
|
"initialization_options": {
|
||||||
"check": {
|
"check": {
|
||||||
"command": "clippy"
|
"command": "clippy",
|
||||||
|
"extraArgs": [
|
||||||
|
"--",
|
||||||
|
"-D",
|
||||||
|
"warnings"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ pub struct ReviewResult {
|
|||||||
pub struct ReviewItem {
|
pub struct ReviewItem {
|
||||||
pub filename: String,
|
pub filename: String,
|
||||||
pub line: Option<u64>,
|
pub line: Option<u64>,
|
||||||
pub code: String,
|
|
||||||
pub message: String,
|
pub message: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ pub struct ReviewPayload {
|
|||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct PullRequest {
|
pub struct PullRequest {
|
||||||
pub id: u64,
|
|
||||||
pub diff_url: String,
|
pub diff_url: String,
|
||||||
pub number: u64,
|
pub number: u64,
|
||||||
pub title: String,
|
pub title: String,
|
||||||
@@ -207,12 +206,10 @@ pub struct PullRequest {
|
|||||||
pub struct Comment {
|
pub struct Comment {
|
||||||
pub id: u64,
|
pub id: u64,
|
||||||
pub body: String,
|
pub body: String,
|
||||||
pub user: User,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
pub id: u64,
|
|
||||||
pub login: String,
|
pub login: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,10 +279,8 @@ mod tests {
|
|||||||
match result.unwrap() {
|
match result.unwrap() {
|
||||||
WebhookType::Review(payload) => {
|
WebhookType::Review(payload) => {
|
||||||
assert_eq!(payload.action, "created");
|
assert_eq!(payload.action, "created");
|
||||||
assert_eq!(payload.pull_request.id, 42);
|
|
||||||
assert_eq!(payload.comment.id, 7);
|
assert_eq!(payload.comment.id, 7);
|
||||||
assert_eq!(payload.comment.body, "@test_bot LGTM");
|
assert_eq!(payload.comment.body, "@test_bot LGTM");
|
||||||
assert_eq!(payload.comment.user.id, 100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -375,10 +370,8 @@ mod tests {
|
|||||||
|
|
||||||
let payload: ReviewPayload = serde_json::from_value(json).unwrap();
|
let payload: ReviewPayload = serde_json::from_value(json).unwrap();
|
||||||
assert_eq!(payload.action, "created");
|
assert_eq!(payload.action, "created");
|
||||||
assert_eq!(payload.pull_request.id, 99);
|
|
||||||
assert_eq!(payload.comment.id, 12);
|
assert_eq!(payload.comment.id, 12);
|
||||||
assert_eq!(payload.comment.body, "Needs work");
|
assert_eq!(payload.comment.body, "Needs work");
|
||||||
assert_eq!(payload.comment.user.id, 200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user