Skip to content

Commit

Permalink
add commits_log example and fix repository_summary
Browse files Browse the repository at this point in the history
  • Loading branch information
LiNk-NY committed Jan 16, 2025
1 parent 10c3d74 commit 9ed6138
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
13 changes: 7 additions & 6 deletions R/commit-stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@
#' start_date = "2023-08-31", end_date = "2024-09-01"
#' )
#' commits_log <- commits_summary(repo_commits, repo_df)
#' repository_summary(
#' summary <- repository_summary(
#' repo_commits, commits_log,
#' start_date = "2023-08-31", end_date = "2024-09-01"
#' )
#' commits_log <-
#' commits_summary(summary$commits_list, summary$repositories)
#' }
#' @export
account_repositories <- function(username, org, github_token = gh::gh_token()) {
Expand Down Expand Up @@ -364,7 +366,8 @@ repository_summary <- function(
total_additions = sum(commit_stats$additions, na.rm = TRUE),
total_deletions = sum(commit_stats$deletions, na.rm = TRUE),
total_files_changed = sum(commit_stats$files_changed, na.rm = TRUE)
)
),
commits_list = commits_list
)
class(summary) <- c("commit_summary", class(summary))
summary
Expand Down Expand Up @@ -418,14 +421,12 @@ summarize_commit_activity <- function(
r_repos <- repo_list_df(repos)
# Step 3: Fetch commits for each R repository
commits_list <- repository_commits(
repos_df = r_repos, username = username, org = org,
github_token = github_token,
repos_df = r_repos, github_token = github_token,
start_date = start_date, end_date = end_date
)
# Step 4: Summarize statistics
repository_summary(
commits_list = commits_list,
repositories = r_repos, username = username, org = org,
commits_list = commits_list, repositories = r_repos,
start_date = start_date, end_date = end_date
)
}
Expand Down
4 changes: 3 additions & 1 deletion man/commit_stats.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/orcid_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ed6138

Please sign in to comment.