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
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ Description:
Pretty-prints R code without changing the user's formatting intent.
Imports:
dplyr,
magrittr,
purrr,
readr,
rlang,
rprojroot,
tibble,
Expand Down
7 changes: 3 additions & 4 deletions R/nested_to_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ create_tree <- function(text) {
#' @param pd_nested A nested tibble.
#' @return An object of class "Node" and "R6".
#' @examples
#' library("magrittr")
#' code <- "a <- function(x) { if(x > 1) { 1+1 } else {x} }"
#' l1 <- styler:::compute_parse_data_nested(code) %>%
#' styler:::pre_visit(c(styler:::create_filler)) %>%
#' styler:::create_node_from_nested_root()
#' nested_pd <- styler:::compute_parse_data_nested(code)
#' initialized <- styler:::pre_visit(nested_pd, c(styler:::create_filler))
#' styler:::create_node_from_nested_root(initialized)
create_node_from_nested_root <- function(pd_nested) {
n <- data.tree::Node$new("ROOT (token: short_text [lag_newlines/spaces] {id})")
create_node_from_nested(pd_nested, n)
Expand Down
12 changes: 11 additions & 1 deletion R/styler.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@
#' according to a style guide. See the INDEX for more information.
#'
"_PACKAGE"
if (getRversion() >= "2.15.1") utils::globalVariables(c("."))
if (getRversion() >= "2.15.1") {
utils::globalVariables(c(
".",
"pd", "pd_nested", "pd_flat", "flattened_pd",
"line1", "line2", "col1", "col2",
"terminal", "text", "short",
"spaces", "lag_spaces",
"newlines", "lag_newlines",
NULL
))
}
7 changes: 3 additions & 4 deletions man/create_node_from_nested_root.Rd

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

2 changes: 0 additions & 2 deletions tests/testthat/public-api/xyzpackage/.Rbuildignore

This file was deleted.

3 changes: 0 additions & 3 deletions tests/testthat/public-api/xyzpackage/.gitignore

This file was deleted.