Skip to content

Commit

Permalink
spaceout add-contribs.R updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed May 15, 2024
1 parent 4330ba5 commit 70e75d4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: allcontributors
Title: Acknowledge all Contributors to a Project
Version: 0.1.1.014
Version: 0.1.1.015
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"))
Description: Acknowledge all contributors to a project via a single
Expand Down
38 changes: 19 additions & 19 deletions R/add-contributors.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ add_contributors <- function (repo = ".",
alphabetical = FALSE,
open_issue = FALSE,
force_update = FALSE) {
all_repos <- do.call(rbind, lapply(repo, function(rep) {
one_repo <- get_contributors_one_repo(
all_repos <- do.call (rbind, lapply (repo, function (rep) {
one_repo <- get_contributors_one_repo (
repo = rep,
type,
exclude_label,
Expand All @@ -95,35 +95,35 @@ add_contributors <- function (repo = ".",
num_sections,
section_names,
format,
alphabetical)
alphabetical
)

return(one_repo)
return (one_repo)
}))

combined_df <- do.call(rbind, all_repos[, 'ctbs'])
combined_df$contributions <- stats::ave(combined_df$contributions, combined_df$login, FUN = sum)
combined_df <- do.call (rbind, all_repos [, "ctbs"])
combined_df$contributions <- stats::ave (combined_df$contributions, combined_df$login, FUN = sum)

# Remove duplicate rows
result <- combined_df[!duplicated(combined_df[c("logins")]), ]
result <- combined_df [!duplicated (combined_df [c ("logins")]), ]

chk <- add_contribs_to_files (
result, all_repos[, 'or'][[1]], ncols, format, files,
result, all_repos [, "or"] [[1]], ncols, format, files,
open_issue, force_update
)

invisible (unlist (chk))
}

get_contributors_one_repo <- function (
repo,
type,
exclude_label,
exclude_issues,
exclude_not_planned,
num_sections,
section_names,
format,
alphabetical) {
get_contributors_one_repo <- function (repo,
type,
exclude_label,
exclude_issues,
exclude_not_planned,
num_sections,
section_names,
format,
alphabetical) {
if (!in_git_repository (repo)) {
stop ("The path [", repo, "] does not appear to be a git repository")
}
Expand Down Expand Up @@ -179,7 +179,7 @@ get_contributors_one_repo <- function (

ctbs <- rename_default_sections (ctbs)

return(list(ctbs = ctbs, or = or))
return (list (ctbs = ctbs, or = or))
}

match_type_arg <- function (type) {
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/ropenscilabs/allcontributors",
"issueTracker": "https://github.com/ropenscilabs/allcontributors/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.1.014",
"version": "0.1.1.015",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 70e75d4

Please sign in to comment.