From 70e75d440760762ee0df79b43ae8f2fd54644e23 Mon Sep 17 00:00:00 2001 From: mpadge Date: Wed, 15 May 2024 14:01:10 +0200 Subject: [PATCH] spaceout add-contribs.R updates --- DESCRIPTION | 2 +- R/add-contributors.R | 38 +++++++++++++++++++------------------- codemeta.json | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5d6425f..46617ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", , "mark.padgham@email.com", role = c("aut", "cre")) Description: Acknowledge all contributors to a project via a single diff --git a/R/add-contributors.R b/R/add-contributors.R index 7ef8ec9..c815c96 100644 --- a/R/add-contributors.R +++ b/R/add-contributors.R @@ -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, @@ -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") } @@ -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) { diff --git a/codemeta.json b/codemeta.json index 2636ff8..2c2d8e7 100644 --- a/codemeta.json +++ b/codemeta.json @@ -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",