Skip to content

Commit

Permalink
Merge pull request #147 from ssi-dk/repo-sync/AEF-DDF/default
Browse files Browse the repository at this point in the history
chore: synced file(s) with ssi-dk/AEF-DDF
  • Loading branch information
RasmusSkytte authored Jul 15, 2024
2 parents 2c5a156 + 4d61c5f commit c5cde05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions R/0_linters.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ nolint_position_linter <- function(length = 80L) {
nolint_info <- source_expression$content |>
stringr::str_locate_all(stringr::regex(r"{# *nolint}", ignore_case = TRUE))

nolint_info <- purrr::map2(
nolint_info,
seq_along(nolint_info),
~ dplyr::mutate(as.data.frame(.x), line_number = .y)
) |>
nolint_info <- purrr::imap(nolint_info, ~ dplyr::mutate(as.data.frame(.x), line_number = .y)) |>
purrr::reduce(rbind) |>
dplyr::filter(!is.na(.data$start)) |>
dplyr::filter(.data$start <= length)
Expand Down Expand Up @@ -176,11 +172,7 @@ non_ascii_linter <- function() {
detection_info <- source_expression$file_lines |>
stringr::str_locate_all(stringr::regex(r"{[^\x00-\x7f]}", ignore_case = TRUE))

detection_info <- purrr::map2(
detection_info,
seq_along(detection_info),
~ dplyr::mutate(as.data.frame(.x), line_number = .y)
)
detection_info <- purrr::imap(detection_info, ~ dplyr::mutate(as.data.frame(.x), line_number = .y))

detection_info <- detection_info |>
purrr::reduce(rbind) |>
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/helper-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ get_test_conns <- function() {
parts <- strsplit(x, "::", fixed = TRUE)[[1]]

# Skip unavailable packages
if (!requireNamespace(parts[1], quietly = TRUE)) {
if (!rlang::is_installed(parts[1])) {
message("Library ", parts[1], " not available!")
return(NULL)
}
Expand Down

0 comments on commit c5cde05

Please sign in to comment.