Skip to content

Commit

Permalink
💄 style package (#118)
Browse files Browse the repository at this point in the history
* style package

* bump dev version

* document
  • Loading branch information
jdhoffa authored Dec 11, 2024
1 parent 9ae21d2 commit 9aefe7c
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 37 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: pacta.sit.rep
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9007
Version: 0.0.0.9008
Authors@R:
person("Jackson", "Hoffart", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-8600-5042"))
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Suggests:
gt,
memoise,
Expand Down
7 changes: 3 additions & 4 deletions R/codeowners.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
get_codeowner <- function(
repo_fullname,
path = ".github/CODEOWNERS", # nolint: non_portable_path
format = TRUE
) {
repo_fullname,
path = ".github/CODEOWNERS", # nolint: non_portable_path
format = TRUE) {
content <- get_gh_text_file(repo_fullname, file_path = path)
if (is.null(content)) {
return(NULL)
Expand Down
14 changes: 6 additions & 8 deletions R/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ if (requireNamespace("memoise")) {
}

identify_if_dep <- function(
repo_fullname,
repos_to_check = list(
prod = c(prod_workflows, r2dii.repos),
experimental = experimental_workflows
),
return_max = TRUE
) {

repo_fullname,
repos_to_check = list(
prod = c(prod_workflows, r2dii.repos),
experimental = experimental_workflows
),
return_max = TRUE) {
dep_lists <- lapply(repos_to_check, function(repos) {
deps <- lapply(
X = repos,
Expand Down
9 changes: 3 additions & 6 deletions R/generate_package_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ format_lifecycle <- function(lifecycle_badge) {
format_lifecycle_v <- Vectorize(format_lifecycle)

format_status <- function(repo, r_cmd_check_status) {

if (is.na(r_cmd_check_status)) {
return("No R CMD check found.")
}
Expand All @@ -68,7 +67,6 @@ format_status <- function(repo, r_cmd_check_status) {
format_status_v <- Vectorize(format_status)

format_coverage <- function(repo, test_coverage) {

if (is.na(test_coverage)) {
return("No test coverage found.")
}
Expand All @@ -79,7 +77,6 @@ format_coverage <- function(repo, test_coverage) {
format_coverage_v <- Vectorize(format_coverage)

format_latest_sha <- function(repo, sha) {

if (is.na(sha)) {
return("`main` branch not found.")
}
Expand All @@ -94,7 +91,6 @@ format_latest_sha <- function(repo, sha) {
format_latest_sha_v <- Vectorize(format_latest_sha)

format_maintainer <- function(maintainer) {

if (is.na(maintainer)) {
return("No maintainer found.")
}
Expand Down Expand Up @@ -138,7 +134,6 @@ table_status <- function(repo_path) {
}

table_coverage <- function(repo_path) {

badge_link <- glue::glue("(https://codecov.io/gh/{repo_path}/branch/main/graph/badge.svg)")
cov_link <- glue::glue("(https://app.codecov.io/gh/{repo_path}?branch=main)")

Expand Down Expand Up @@ -181,7 +176,9 @@ fetch_main_sha <- function(repo_path) {
"/repos/{repo}/branches/main",
repo = repo_path
),
error = function(cond) return(NULL)
error = function(cond) {
return(NULL)
}
)

if (!is.null(response)) {
Expand Down
1 change: 0 additions & 1 deletion R/generate_workflow_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ generate_workflow_table <- function(repo_paths) {
}

format_docker <- function(docker_status) {

if (is.na(docker_status)) {
return("No Docker check found.")
}
Expand Down
8 changes: 6 additions & 2 deletions R/get_gh_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ get_gh_text_file <- function(repo_fullname, file_path) {
file_path = file_path
)
},
error = function(cond) return(NULL)
error = function(cond) {
return(NULL)
}
)
if (is.null(response)) {
out <- NULL
Expand Down Expand Up @@ -42,7 +44,9 @@ get_gh_dir_listing <- function(repo_fullname, dir_path) {
dir_path = dir_path
)
},
error = function(cond) return(NULL)
error = function(cond) {
return(NULL)
}
)
if (is.null(response)) {
out <- NULL
Expand Down
3 changes: 2 additions & 1 deletion R/get_repos.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
get_repos <- function(org) {
repo_fetch <- gh::gh(
"GET /orgs/{org}/repos", # nolint: non_portable_path
org = org, per_page = 20L)
org = org, per_page = 20L
)
all_repos <- repo_fetch
while (
grepl(
Expand Down
1 change: 0 additions & 1 deletion R/repo_lists.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ experimental_workflows <- c(
"RMI-PACTA/workflow.pacta.data.qa",
"RMI-PACTA/workflow.pacta.report"
)

8 changes: 6 additions & 2 deletions R/rulesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ get_rulesets <- function(repo_fullname) {
repo_fullname = repo_fullname
)
},
error = function(cond) return(NULL)
error = function(cond) {
return(NULL)
}
)
if (is.null(response)) {
out <- NULL
Expand Down Expand Up @@ -34,7 +36,9 @@ get_ruleset_contents <- function(repo_fullname, ruleset_id) {
ruleset_id = ruleset_id
)
},
error = function(cond) return(NULL)
error = function(cond) {
return(NULL)
}
)
if (is.null(response)) {
out <- NULL
Expand Down
11 changes: 5 additions & 6 deletions R/workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ check_workflows <- function(repo_fullname) {
}

workflow_summary <- function(
repo_fullname,
expected = c(
"R.yml",
"docker.yml"
)
) {
repo_fullname,
expected = c(
"R.yml",
"docker.yml"
)) {
workflows <- check_workflows(repo_fullname)
workflow_summary <- list()
for (wf in expected) {
Expand Down
4 changes: 0 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ banks_repos <- c(
banks_table <- pacta.sit.rep::generate_package_table(banks_repos)
knitr::kable(banks_table)
```

### Transition Monitor
Expand All @@ -58,7 +57,6 @@ transition_monitor_repos <- c(
tm_table <- pacta.sit.rep::generate_package_table(transition_monitor_repos)
knitr::kable(tm_table)
```

### PACTA for Supervisors
Expand All @@ -70,7 +68,6 @@ supervisor_repos <- c(
tm_table <- pacta.sit.rep::generate_package_table(supervisor_repos)
knitr::kable(tm_table)
```

## Workflows and Docker Images
Expand All @@ -86,5 +83,4 @@ transition_monitor_workflows <- c(
workflow_table <- pacta.sit.rep::generate_workflow_table(transition_monitor_workflows)
knitr::kable(workflow_table)
```

0 comments on commit 9aefe7c

Please sign in to comment.