From 9c4fc1eda8bcc0e56f88537e21cd93dafa35919f Mon Sep 17 00:00:00 2001 From: Lorenz Walthert Date: Sat, 23 Jan 2021 23:40:09 +0100 Subject: [PATCH] make things work for R < 3.6 --- R/style-guides.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/style-guides.R b/R/style-guides.R index 2cca5a571..4ed1c6dc8 100644 --- a/R/style-guides.R +++ b/R/style-guides.R @@ -179,7 +179,11 @@ tidyverse_style <- function(scope = "tokens", token = list( resolve_semicolon = "';'", add_brackets_in_pipe = "SPECIAL-PIPE", - force_assignment_op = c("token" = "EQ_ASSIGN"), + # before 3.6, these assignments are not wrapped into top level expression + # and `text` supplied to transformer_subset() is "", so it appears to not + # contain EQ_ASSIGN, and the transformer is falsely removed. + # compute_parse_data_nested / text_to_flat_pd ('a = 4') + if (getRversion() >= 3.6) force_assignment_op <- "EQ_ASSIGN", wrap_if_else_while_for_fun_multi_line_in_curly = c("IF", "WHILE", "FOR", "FUNCTION") ), line_break = list(