Skip to content
Closed
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 R/inflate-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ parse_test <- function(x, pkg, relative_flat_file) { # x <- rmd_test[1,]
}

lines <- c(
sprintf("# WARNING - Generated by {fusen} from %s: do not edit by hand\n", relative_flat_file),
sprintf("# WARNING - Generated by {fusen} from %s: do not edit by hand # nolint: line_length_linter.\n", relative_flat_file),
x[["code"]][[1]]
)
write_utf8(path = test_file, lines = lines)
Expand Down
2 changes: 1 addition & 1 deletion R/inflate.R
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ create_r_files <- function(fun_code, pkg, relative_flat_file) {
cli::cli_alert_warning(paste(basename(r_file), "has been overwritten"))
}
lines <- c(
sprintf("# WARNING - Generated by {fusen} from %s: do not edit by hand\n", relative_flat_file),
sprintf("# WARNING - Generated by {fusen} from %s: do not edit by hand # nolint: line_length_linter.\n", relative_flat_file),
unlist(fun_code[x, ][["code_example"]])
)
write_utf8(path = r_file, lines = lines)
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-inflate-part1.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ usethis::with_project(dummypackage, {
test_that("inflate - R files contents are ok", {
# examples in R files
my_median_lines <- readLines(my_median_file)
expect_equal(my_median_lines[1], "# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand")
expect_equal(my_median_lines[1], "# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand # nolint: line_length_linter.")
expect_true(all(my_median_lines[12:14] == c(
"#' @examples",
"#' my_median(2:20)",
"#' my_median(1:12)"
)))
my_other_median_lines <- readLines(my_other_median_file)
expect_equal(my_other_median_lines[1], "# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand")
expect_equal(my_other_median_lines[1], "# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand # nolint: line_length_linter.")
expect_true(all(my_other_median_lines[12:15] == c(
"#' @examples",
"#' my_other_median(1:12)",
Expand Down Expand Up @@ -117,7 +117,7 @@ usethis::with_project(dummypackage, {
# _no roxygen at all
my_norox_lines <- readLines(my_noroxfunctionfile)
expect_true(all(my_norox_lines == c(
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand",
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand # nolint: line_length_linter.",
"",
"#' @noRd",
"my_norox <- function(x) {",
Expand All @@ -130,7 +130,7 @@ usethis::with_project(dummypackage, {
expect_equal(
my_norox2_lines,
c(
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand",
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand # nolint: line_length_linter.",
"",
"#' @noRd",
"#' @examples",
Expand Down Expand Up @@ -192,7 +192,7 @@ usethis::with_project(dummypackage, {
expect_equal(
test_lines,
c(
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand",
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand # nolint: line_length_linter.",
"",
"test_that(\"my_median works properly and show error if needed\", {",
" expect_error(my_median(\"text\"))",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-inflate-part2.R
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ usethis::with_project(dummypackage, {
expect_equal(
lines,
c(
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand",
"# WARNING - Generated by {fusen} from dev/flat_full.Rmd: do not edit by hand # nolint: line_length_linter.",
"",
"#' my_twoexamples",
"#' @param x x",
Expand Down