Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up post paws regen #894

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cran/paws.management/R/opsworks_service.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ NULL
#' Node.js](https://docs.aws.amazon.com/sdk-for-javascript/)
#'
#' - [SDK for Python
#' (Boto)](http://docs.pythonboto.org/en/latest/ref/opsworks.html)
#' (Boto)](https://docs.pythonboto.org/en/latest/ref/opsworks.html)
#'
#' **Endpoints**
#'
Expand Down
2 changes: 1 addition & 1 deletion cran/paws.management/man/opsworks.Rd

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

2 changes: 1 addition & 1 deletion cran/paws/R/paws.R
Original file line number Diff line number Diff line change
Expand Up @@ -22712,7 +22712,7 @@ cloudwatchobservabilityaccessmanager <- function(
#' Node.js](https://docs.aws.amazon.com/sdk-for-javascript/)
#'
#' - [SDK for Python
#' (Boto)](http://docs.pythonboto.org/en/latest/ref/opsworks.html)
#' (Boto)](https://docs.pythonboto.org/en/latest/ref/opsworks.html)
#'
#' **Endpoints**
#'
Expand Down
2 changes: 1 addition & 1 deletion cran/paws/man/opsworks.Rd

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

14 changes: 9 additions & 5 deletions make.paws/R/sdk_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ paws_release_sub_cat <- function(in_dir = "../cran", pkg_list = list()) {

cran_comment_template <- "## Test environments

* local macOS install, R 4.2.1
* local %s install, %s
* R-hub (devel and release)
* win-builder

Expand Down Expand Up @@ -453,6 +453,8 @@ paws_build_cran_comments <- function(
]
cran_comments <- sprintf(
cran_comment_template,
utils::osVersion,
R.version.string,
dir_info$cran_comment,
dir_info$size,
dir_info$downstream_info
Expand Down Expand Up @@ -497,10 +499,12 @@ paws_gsub <- function(
cran_file_gsub <- function(before, after, files) {
for (file in files) {
result <- readLines(file)
found <- grep(before, result)
if (length(found) > 0) {
result[found] <- gsub(before, after, result[found])
writeLines(result, file)
for (i in seq_along(before)) {
found <- grep(before[i], result)
if (length(found) > 0) {
result[found] <- gsub(before[i], after[i], result[found])
writeLines(result, file)
}
}
}
}
Expand Down
24 changes: 20 additions & 4 deletions make.paws/tests/testthat/test_sdk_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,19 @@ test_that("check paws_build_cran_comments", {
mockery::mock_args(mock_write_line),
list(
list(
"## Test environments\n\n* local macOS install, R 4.2.1\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs or Notes.\nWarnings:this is a dummy warning\n\nMaintainer Notes: tarball package size: 456K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
sprintf(
"## Test environments\n\n* local %s install, %s\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs or Notes.\nWarnings:this is a dummy warning\n\nMaintainer Notes: tarball package size: 456K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
utils::osVersion,
R.version.string
),
con = "made_up/paws.cat1/cran-comments.md"
),
list(
"## Test environments\n\n* local macOS install, R 4.2.1\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs, or WARNINGs.\nNotes:\nthis is a dummy note\n\nMaintainer Notes: tarball package size: 789K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
sprintf(
"## Test environments\n\n* local %s install, %s\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs, or WARNINGs.\nNotes:\nthis is a dummy note\n\nMaintainer Notes: tarball package size: 789K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
utils::osVersion,
R.version.string
),
con = "made_up/paws.cat2/cran-comments.md"
)
)
Expand Down Expand Up @@ -513,11 +521,19 @@ test_that("check paws_build_cran_comments from cache", {
mockery::mock_args(mock_write_line),
list(
list(
"## Test environments\n\n* local macOS install, R 4.2.1\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs or Notes.\nWarnings:this is a dummy warning\n\nMaintainer Notes: tarball package size: 456K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
sprintf(
"## Test environments\n\n* local %s install, %s\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs or Notes.\nWarnings:this is a dummy warning\n\nMaintainer Notes: tarball package size: 456K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
utils::osVersion,
R.version.string
),
con = "made_up/paws.cat1/cran-comments.md"
),
list(
"## Test environments\n\n* local macOS install, R 4.2.1\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs, or WARNINGs.\nNotes:\nthis is a dummy note\n\nMaintainer Notes: tarball package size: 789K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
sprintf(
"## Test environments\n\n* local %s install, %s\n* R-hub (devel and release)\n* win-builder\n\n## R CMD check results\n\nThere were no ERRORs, or WARNINGs.\nNotes:\nthis is a dummy note\n\nMaintainer Notes: tarball package size: 789K\n\n## Downstream dependencies\n\nAll downstream dependencies ('paws') pass R CMD check.",
utils::osVersion,
R.version.string
),
con = "made_up/paws.cat2/cran-comments.md"
)
)
Expand Down
2 changes: 1 addition & 1 deletion paws/R/opsworks_service.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ NULL
#' Node.js](https://docs.aws.amazon.com/sdk-for-javascript/)
#'
#' - [SDK for Python
#' (Boto)](http://docs.pythonboto.org/en/latest/ref/opsworks.html)
#' (Boto)](https://docs.pythonboto.org/en/latest/ref/opsworks.html)
#'
#' **Endpoints**
#'
Expand Down
10 changes: 5 additions & 5 deletions script/post_build_formatting.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ before <- c(
"#' \\*arn:aws:iam:::role/\\*/ResourceName_\\?\\*",
"#' \\*arn:aws:iam:::role/pathA/pathB/ResourceName_1\\*",
"#' \\*arn:aws:iam:::role/pathA/ResourceName_1\\*",
"\u2028"
"\u2028",
"http://docs.pythonboto.org"
)

after <- c(
Expand All @@ -32,12 +33,11 @@ after <- c(
"#' \\\\emph\\{arn:aws:iam:::role/&#42;/ResourceName_\\?\\}",
"#' \\\\emph\\{arn:aws:iam:::role/pathA/pathB/ResourceName_1\\}",
"#' \\\\emph\\{arn:aws:iam:::role/pathA/ResourceName_1\\}",
""
"",
"https://docs.pythonboto.org"
)

for (i in seq_along(before)) {
paws_gsub(root = root, before = before[i], after = after[i])
}
paws_gsub(root = root, before = before, after = after)

paws_unescape_latex_post_build(root = root)
paws_fix_html_span(root = root)
Expand Down
Loading