Skip to content
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
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ importFrom(purrr,flatten_int)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map2_chr)
importFrom(purrr,map2_lgl)
importFrom(purrr,map_at)
importFrom(purrr,map_chr)
importFrom(purrr,map_int)
Expand Down
3 changes: 1 addition & 2 deletions R/nest.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ drop_cached_children <- function(pd) {
pos_ids_to_keep <- pd_parent_first %>%
split(cumsum(pd_parent_first$parent == 0)) %>%
map(find_pos_id_to_keep) %>%
unlist() %>%
unname()
unlist(use.names = FALSE)
pd[pd$pos_id %in% pos_ids_to_keep, ]
} else {
pd
Expand Down
14 changes: 8 additions & 6 deletions R/parse.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ is_insufficiently_parsed_string <- function(pd) {
is_insufficiently_parsed_number <- function(pd) {
grepl("^0x", pd$text) & pd$token == "NUM_CONST"
}
#' @importFrom purrr map2_lgl

#' Check whether columns match
#' @keywords internal
#' @noRd
lines_and_cols_match <- function(data) {
left <- paste0(line_col_names(), "")
right <- paste0(line_col_names(), "parent")
map2_lgl(left, right,
two_cols_match,
data = data
) %>%
all()
identical(
unlist(data[left], use.names = FALSE),
unlist(data[right], use.names = FALSE)
)
}
2 changes: 1 addition & 1 deletion R/stylerignore.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env_add_stylerignore <- function(pd_flat) {
pd_flat_temp$pos_id, cumsum(is_stylerignore_switchpoint)
) %>%
map(~ rep(.x[1], length(.x))) %>%
unlist()
unlist(use.names = FALSE)
pd_flat_temp$lag_newlines <- pd_flat_temp$lag_newlines
pd_flat_temp$lag_spaces <- lag(pd_flat_temp$spaces, default = 0)
is_terminal_to_ignore <- pd_flat_temp$terminal & pd_flat_temp$stylerignore
Expand Down
2 changes: 1 addition & 1 deletion R/transform-block.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ parse_transform_serialize_r_block <- function(pd_nested,
paste0(rep_char(" ", base_indention), pd_nested$text),
~ c(rep("", .x), .y)
) %>%
unlist()
unlist(use.names = FALSE)
}
c(rep("", start_line - 1), serialized_transformed_text)
}
Expand Down
2 changes: 1 addition & 1 deletion R/transform-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ parse_transform_serialize_r <- function(text,
)
}

text_out <- unlist(text_out)
text_out <- unlist(text_out, use.names = FALSE)

verify_roundtrip(
text, text_out,
Expand Down
2 changes: 1 addition & 1 deletion R/utils-cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ cache_write <- function(text, transformers, more_specs) {
file.create()
}

styler_version <- unlist(unname(read.dcf("DESCRIPTION")[, "Version"]))
styler_version <- unlist(unname(read.dcf("DESCRIPTION")[, "Version"]), use.names = FALSE)

cache_get_name <- function() {
getOption("styler.cache_name")
Expand Down
2 changes: 1 addition & 1 deletion R/utils-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ map_filetype_to_pattern <- function(filetype) {
#' setdiff("./file.R", "file.R") # you want to standardize first.
dir_without_. <- function(path, recursive = TRUE, ...) {
purrr::map(path, dir_without_._one, recursive = recursive, ...) %>%
unlist()
unlist(use.names = FALSE)
}

#' `dir()`, but with full names, ignored case, and included hidden files and
Expand Down
11 changes: 1 addition & 10 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ convert_newlines_to_linebreaks <- function(text) {
} else {
.x
}) %>%
unlist()
}

#' Check whether two columns match
#'
#' @param col1,col2 Column names as string.
#' @param data The data frames that contains `col1` and `col2`.
#' @keywords internal
two_cols_match <- function(col1, col2, data) {
all(unlist(data[col1]) == unlist(data[col2]))
unlist(use.names = FALSE)
}

odd_index <- function(x) {
Expand Down
17 changes: 0 additions & 17 deletions man/two_cols_match.Rd

This file was deleted.