Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds additions / deletions to each PR message #38

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub struct GithubPullRequest {
pub head: GithubBranch,
pub labels: Vec<GithubLabel>,
pub created_at: DateTime<Utc>,
pub additions: u32,
pub deletions: u32,
}

#[derive(Deserialize, Debug)]
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ fn make_message(pull_request: GithubPullRequest, show_pr_age: bool) -> String {
format!("👤 {}", pull_request.user.login)
};

format!("{}{} \n\n{}\n", message, age_output, user)
let changes = format!("[+{}/-{}]", pull_request.additions, pull_request.deletions);
NovemberTang marked this conversation as resolved.
Show resolved Hide resolved

format!("{}{} \n\n{} {}\n", message, age_output, user, changes)
}

fn get_age(d1: DateTime<Utc>, d2: DateTime<Utc>) -> String {
Expand Down