Skip to content

Commit 9b165d6

Browse files
committed
style: fix lints
1 parent 0cffe94 commit 9b165d6

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

R/pkgpurl.gen.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See `README.md#r-markdown-format` for more information on the literate programming approach used applying the R Markdown format.
33

44
# pkgpurl: Facilitate Authoring R Packages in the R Markdown File Format
5-
# Copyright (C) 2024 Salim Brüggemann
5+
# Copyright (C) 2025 Salim Brüggemann
66
#
77
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free
88
# Software Foundation, either version 3 of the License, or any later version.
@@ -153,9 +153,13 @@ extract_md_heading_content <- function(x,
153153
stringr::str_remove(pattern = "^#+") |>
154154
stringr::str_trim() |>
155155
purrr::map_chr(\(x) {
156-
if (x == "") NA_character_ else knitr::knit(text = x,
157-
quiet = TRUE,
158-
envir = env)
156+
if (x == "") {
157+
NA_character_
158+
} else {
159+
knitr::knit(text = x,
160+
quiet = TRUE,
161+
envir = env)
162+
}
159163
})
160164
}
161165

@@ -961,7 +965,7 @@ gen_pkgdown_ref <- function(rmd,
961965
quiet = TRUE,
962966
envir = env) |>
963967
stringr::str_trim() |>
964-
pal::when(length(.) > 0L ~ paste0(., collapse = "\n\n"),
968+
pal::when(length(.) > 0L ~ paste(., collapse = "\n\n"),
965969
~ NA_character_)
966970
})),
967971
by = "i_title") %>%
@@ -989,7 +993,7 @@ gen_pkgdown_ref <- function(rmd,
989993
quiet = TRUE,
990994
envir = env) |>
991995
stringr::str_trim() |>
992-
pal::when(length(.) > 0L ~ paste0(., collapse = "\n\n"),
996+
pal::when(length(.) > 0L ~ paste(., collapse = "\n\n"),
993997
~ NA_character_)
994998
})),
995999
by = "i_subtitle")

Rmd/pkgpurl.Rmd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,13 @@ extract_md_heading_content <- function(x,
191191
stringr::str_remove(pattern = "^#+") |>
192192
stringr::str_trim() |>
193193
purrr::map_chr(\(x) {
194-
if (x == "") NA_character_ else knitr::knit(text = x,
195-
quiet = TRUE,
196-
envir = env)
194+
if (x == "") {
195+
NA_character_
196+
} else {
197+
knitr::knit(text = x,
198+
quiet = TRUE,
199+
envir = env)
200+
}
197201
})
198202
}
199203
```
@@ -1119,7 +1123,7 @@ gen_pkgdown_ref <- function(rmd,
11191123
quiet = TRUE,
11201124
envir = env) |>
11211125
stringr::str_trim() |>
1122-
pal::when(length(.) > 0L ~ paste0(., collapse = "\n\n"),
1126+
pal::when(length(.) > 0L ~ paste(., collapse = "\n\n"),
11231127
~ NA_character_)
11241128
})),
11251129
by = "i_title") %>%
@@ -1147,7 +1151,7 @@ gen_pkgdown_ref <- function(rmd,
11471151
quiet = TRUE,
11481152
envir = env) |>
11491153
stringr::str_trim() |>
1150-
pal::when(length(.) > 0L ~ paste0(., collapse = "\n\n"),
1154+
pal::when(length(.) > 0L ~ paste(., collapse = "\n\n"),
11511155
~ NA_character_)
11521156
})),
11531157
by = "i_subtitle")

0 commit comments

Comments
 (0)