Skip to content

Commit

Permalink
spaceout
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jun 29, 2023
1 parent d344189 commit 2c6b2cc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: roreviewapi
Title: Plumber API to report package structure and function
Version: 0.0.2.186
Version: 0.0.2.187
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
53 changes: 26 additions & 27 deletions R/gh-issue.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' Check template variables in GitHub issue
#'
#' @param orgrepo GitHub organization and repo as single string separated by
Expand Down Expand Up @@ -38,8 +37,8 @@ check_issue_template <- function (orgrepo, issue_num) {

# separate checks for optional stats variable:
if (has_html_variable (x, "statsgrade")) {
chk <- c (chk, check_html_variable (x, "statsgrade"))
}
chk <- c (chk, check_html_variable (x, "statsgrade"))
}

chk <- chk [which (nchar (chk) > 0L)]

Expand Down Expand Up @@ -168,11 +167,11 @@ check_html_variable <- function (x, variable) {
variable <- match.arg (variable, html_variables)

if (!has_html_variable (x, variable)) {
return (paste0 (
"HTML variable [", variable,
"] is missing"
))
}
return (paste0 (
"HTML variable [", variable,
"] is missing"
))
}

x <- get_html_variable (x, variable)

Expand All @@ -183,39 +182,39 @@ check_html_variable <- function (x, variable) {
# GitHub handle only (#17):
check <- grepl ("^@(\\w|\\-|\\_)+$", x)
if (!check) {
out <- paste0 (
"'author1' variable must be ",
"GitHub hanle only ('@myhandle')"
)
}
out <- paste0 (
"'author1' variable must be ",
"GitHub hanle only ('@myhandle')"
)
}

} else if (variable == "repourl") {

if (!url_exists (x)) {
out <- paste0 ("URL = [", x, "] is not valid")
}
out <- paste0 ("URL = [", x, "] is not valid")
}

} else if (variable == "submission-type") {

# Have to iconv to convert accented "a" to ascii:
x <- iconv (x, to = "ASCII//TRANSLIT")
if (!x %in% submission_types) {
out <- paste0 (
"submission type must be one of [",
paste0 (submission_types, collapse = ", "),
"]"
)
}
out <- paste0 (
"submission type must be one of [",
paste0 (submission_types, collapse = ", "),
"]"
)
}

} else if (variable == "statsgrade") {

if (!tolower (x) %in% stats_grades) {
out <- paste0 (
"'statsgrade' variable must be one of [",
paste0 (stats_grades, collapse = ", "),
"]"
)
}
out <- paste0 (
"'statsgrade' variable must be one of [",
paste0 (stats_grades, collapse = ", "),
"]"
)
}
}

return (out)
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/roreviewapi",
"issueTracker": "https://github.com/ropensci-review-tools/roreviewapi/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.2.186",
"version": "0.0.2.187",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 2c6b2cc

Please sign in to comment.