diff --git a/tests/testmanual/addins/r-valid.R b/tests/testmanual/addins/r-valid.R index 612dabf52..d5d4623db 100644 --- a/tests/testmanual/addins/r-valid.R +++ b/tests/testmanual/addins/r-valid.R @@ -1 +1,3 @@ -1+ 1 +1 + 1 # tst +# flush +#more diff --git a/tests/testthat/alignment/named-in.R b/tests/testthat/alignment/named-in.R index 3a4eacf4e..5fd8e9507 100644 --- a/tests/testthat/alignment/named-in.R +++ b/tests/testthat/alignment/named-in.R @@ -24,25 +24,25 @@ call( # algorithm: not aligned (spacing around =). human: aligned (fix: spacing around =). call( - x =1, kdd = 2, - xy =2, n = 33, + x = 1, kdd = 2, + xy = 2, n = 33, ) # algorithm: not aligned. human: not aligned. call( - x = 1, kdd = 2, + x = 1, kdd = 2, xy = 2, n = 33, ) # algorithm: not aligned. human: not aligned. call( - x = 1, kdd = 2, + x = 1, kdd = 2, xy = 22, n = 33, ) # algorithm: not aligned. human: not aligned. call( - x = 1, d = 2, + x = 1, d = 2, xy = 22, n = 33, ) @@ -63,7 +63,6 @@ call( # algorithm: aligned. human: aligned. call( x = 1, n = 33, z = "333", - xy = 2, ) @@ -107,8 +106,8 @@ call( # if all col1 arguments are named, col1 must also be aligned # not aligned fell( - x = 1, - y = 23, + x = 1, + y = 23, zz = NULL ) @@ -122,8 +121,8 @@ fell( # aligned but comma in the wrong line call( a = 2, - bb = 3 -,) + bb = 3, +) # aligned (comments) @@ -155,15 +154,15 @@ call( # not aligned (comments) call( - a = 2, x = 111, - bb = 3, # hi + a = 2, x = 111, + bb = 3, # hi ) # not aligned (comments) call( # another one - a = 2, x = 111, - bb = 3, + a = 2, x = 111, + bb = 3, # hi ) @@ -173,8 +172,7 @@ call( # the extra spaces before `=` as of 29a010064257fa1a9caf32d182e7ee62008de98a. call( x = 95232, - y = f( - ), + y = f(), ) @@ -187,9 +185,9 @@ ca( # not aligned (left after `=`) ca( - x = 23200, + x = 23200, y2 = "hi", - m = c(rm.na = 7) + m = c(rm.na = 7) ) # aligned =, first all named diff --git a/tests/testthat/alignment/tribble-in.R b/tests/testthat/alignment/tribble-in.R index 2a9dd913c..2e618487e 100644 --- a/tests/testthat/alignment/tribble-in.R +++ b/tests/testthat/alignment/tribble-in.R @@ -5,22 +5,22 @@ tribble( ) tribble( - ~x, ~d, + ~x, ~d, "axa'fa", 1:6, - "b", 4:6 + "b", 4:6 ) tribble( - ~x, ~d, + ~x, ~d, "axa'fa", 1:6, -"b", 4:6 + "b", 4:6 ) tribble( - ~x, ~d, -"axa'fa", 1:6, - "b", 4:6 + ~x, ~d, + "axa'fa", 1:6, + "b", 4:6 ) # has EQ_SUB which don't match, not tribble-like diff --git a/tests/testthat/curly-curly/mixed-in.R b/tests/testthat/curly-curly/mixed-in.R index 727c2ef89..8ce8d6f5e 100644 --- a/tests/testthat/curly-curly/mixed-in.R +++ b/tests/testthat/curly-curly/mixed-in.R @@ -5,28 +5,17 @@ call({{ x }}) # removing line breaks -call({{ - x -}}) +call({{ x }}) -call({ - {x -}}) +call({{ x }}) -call({ - {x}} -) +call({{ x }}) -call({ - {x} - }) +call({{ x }}) call( - { - {x - } - } - ) + {{ x }} +) ## ............................................................................ ## spaces #### @@ -35,33 +24,37 @@ call( call({{ x }}) # removing spaces between braces -call({ { x }}) -call({ { x }} ) -call( { { x }}) -call( { { x } }) +call({{ x }}) +call({{ x }}) +call({{ x }}) +call({{ x }}) # inserting spaces within {{ -call({{x }}) -call({{x}}) -call({{ x}}) +call({{ x }}) +call({{ x }}) +call({{ x }}) # not removing spaces within {{ call({{ x }}) # combine spaces and line breaks -call({{ x} - }) +call({{ x }}) -call({ - { x}}) +call({{ x }}) # not applicable when only one curly brace { y } -{ 1 + 1} -{{1 + a} + 1} # not curly-culry! +{ + 1 + 1 +} +{ + { + 1 + a + } + 1 +} # not curly-culry! ## ............................................................................ @@ -71,30 +64,37 @@ call("test", { }) call( - "test", { - 1 -}) - -call("test", - { + "test", + { 1 - }) + } +) call("test", { - 1 } -) + 1 +}) -call({ +call("test", { 1 -}, a + b, { 33 / f(c)}) +}) + +call( + { + 1 + }, + a + b, + { + 33 / f(c) + } +) -call({{ x }}, {{ y}}) -call({{ x }}, {{ y} - }) +call({{ x }}, {{ y }}) +call({{ x }}, {{ y }}) call( - {{ x }}, {{ y}}) + {{ x }}, {{ y }} +) call( {{ x }}, - {{ y}} := 3, f(bk) + {{ y }} := 3, f(bk) ) diff --git a/tests/testthat/fun_dec/fun_dec_scope_spaces-in.R b/tests/testthat/fun_dec/fun_dec_scope_spaces-in.R index 4b7ad4dc7..c82b715ed 100644 --- a/tests/testthat/fun_dec/fun_dec_scope_spaces-in.R +++ b/tests/testthat/fun_dec/fun_dec_scope_spaces-in.R @@ -1,12 +1,11 @@ a <- function(x, # -y -) { + y) { x - 1 } a <- function(x, # - y) # + y) # { x } @@ -23,5 +22,4 @@ function(a = function(a = b, - c -) {} + c) {} diff --git a/tests/testthat/fun_dec/fun_dec_scope_spaces-out.R b/tests/testthat/fun_dec/fun_dec_scope_spaces-out.R index 4b7ad4dc7..c82b715ed 100644 --- a/tests/testthat/fun_dec/fun_dec_scope_spaces-out.R +++ b/tests/testthat/fun_dec/fun_dec_scope_spaces-out.R @@ -1,12 +1,11 @@ a <- function(x, # -y -) { + y) { x - 1 } a <- function(x, # - y) # + y) # { x } @@ -23,5 +22,4 @@ function(a = function(a = b, - c -) {} + c) {} diff --git a/tests/testthat/fun_dec/line_break_fun_dec-in.R b/tests/testthat/fun_dec/line_break_fun_dec-in.R index 4bf36e4ac..81aff8516 100644 --- a/tests/testthat/fun_dec/line_break_fun_dec-in.R +++ b/tests/testthat/fun_dec/line_break_fun_dec-in.R @@ -29,20 +29,18 @@ a <- function(x, } a <- function(x, - y) { x - 1 } -a <- function( - x, +a <- function(x, y) { x - 1 } a <- function( # - x, - y) { + x, + y) { x - 1 } diff --git a/tests/testthat/indention_curly_brackets/multi_line_curly_only-in.R b/tests/testthat/indention_curly_brackets/multi_line_curly_only-in.R index f06c54945..702d2c601 100644 --- a/tests/testthat/indention_curly_brackets/multi_line_curly_only-in.R +++ b/tests/testthat/indention_curly_brackets/multi_line_curly_only-in.R @@ -1,4 +1,6 @@ - { - {1 + 3} -{2 + sin(pi)} - } +{{ + 1 + 3 +} +{ + 2 + sin(pi) +}} diff --git a/tests/testthat/indention_curly_brackets/multi_line_curly_only-out.R b/tests/testthat/indention_curly_brackets/multi_line_curly_only-out.R index b2db83528..702d2c601 100644 --- a/tests/testthat/indention_curly_brackets/multi_line_curly_only-out.R +++ b/tests/testthat/indention_curly_brackets/multi_line_curly_only-out.R @@ -1,8 +1,6 @@ -{ - { - 1 + 3 - } - { - 2 + sin(pi) - } +{{ + 1 + 3 } +{ + 2 + sin(pi) +}} diff --git a/tests/testthat/indention_curly_brackets/multi_line_curly_round_only-in.R b/tests/testthat/indention_curly_brackets/multi_line_curly_round_only-in.R index 192e43770..745c5b262 100644 --- a/tests/testthat/indention_curly_brackets/multi_line_curly_round_only-in.R +++ b/tests/testthat/indention_curly_brackets/multi_line_curly_round_only-in.R @@ -1,9 +1,11 @@ a <- function(x) { -x <- c(1, - 2 + 3, -sin(pi)) + x <- c( + 1, + 2 + 3, + sin(pi) + ) -if(x > 10) { + if (x > 10) { return("done") - } - } + } +} diff --git a/tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-in.R b/tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-in.R index 25d11d1b3..851b79121 100644 --- a/tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-in.R +++ b/tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-in.R @@ -1,9 +1,11 @@ -b<-function(x ){ - x <- c(1, - 2+ 3, - sin(pi) ) +b <- function(x) { + x <- c( + 1, + 2 + 3, + sin(pi) + ) - if(x > 10){ -return("done") + if (x > 10) { + return("done") } - } +} diff --git a/tests/testthat/indention_curly_brackets/multi_line_curly_while_for_if_fun-in.R b/tests/testthat/indention_curly_brackets/multi_line_curly_while_for_if_fun-in.R index 6c37fe95f..babdc4a26 100644 --- a/tests/testthat/indention_curly_brackets/multi_line_curly_while_for_if_fun-in.R +++ b/tests/testthat/indention_curly_brackets/multi_line_curly_while_for_if_fun-in.R @@ -1,10 +1,10 @@ -a <- function(x, y, z) { - while(2+2> call(3,1)) { +a <- function(x, y, z) { + while (2 + 2 > call(3, 1)) { if (isTRUE(x)) { b -} } - for(a in 1:19){ - x[i] +1 + } + for (a in 1:19) { + x[i] + 1 } } diff --git a/tests/testthat/indention_curly_brackets/one_line_curly-in.R b/tests/testthat/indention_curly_brackets/one_line_curly-in.R index 1861090d8..9904d1ce8 100644 --- a/tests/testthat/indention_curly_brackets/one_line_curly-in.R +++ b/tests/testthat/indention_curly_brackets/one_line_curly-in.R @@ -1 +1,3 @@ -a <- {1+1} +a <- { + 1 + 1 +} diff --git a/tests/testthat/indention_fun_calls/non_strict_calls-in.R b/tests/testthat/indention_fun_calls/non_strict_calls-in.R index 073dbc9e7..6517b6914 100644 --- a/tests/testthat/indention_fun_calls/non_strict_calls-in.R +++ b/tests/testthat/indention_fun_calls/non_strict_calls-in.R @@ -1,16 +1,24 @@ -call(a, - b) +call( + a, + b +) call(a, - b = 3) + b = 3 +) -call(a = 1, b = - 3) +call( + a = 1, b = + 3 +) -call(a = - 1, b = 3) +call( + a = + 1, b = 3 +) -call(a = 1, +call( + a = 1, b = 3 ) diff --git a/tests/testthat/indention_fun_calls/non_strict_calls-out.R b/tests/testthat/indention_fun_calls/non_strict_calls-out.R index 3db1f68f7..6517b6914 100644 --- a/tests/testthat/indention_fun_calls/non_strict_calls-out.R +++ b/tests/testthat/indention_fun_calls/non_strict_calls-out.R @@ -1,16 +1,24 @@ -call(a, - b) +call( + a, + b +) call(a, - b = 3) + b = 3 +) -call(a = 1, b = - 3) +call( + a = 1, b = + 3 +) -call(a = - 1, b = 3) +call( + a = + 1, b = 3 +) -call(a = 1, +call( + a = 1, b = 3 ) diff --git a/tests/testthat/indention_fun_calls/strict_calls-in.R b/tests/testthat/indention_fun_calls/strict_calls-in.R index 9e0750314..d59ddaf63 100644 --- a/tests/testthat/indention_fun_calls/strict_calls-in.R +++ b/tests/testthat/indention_fun_calls/strict_calls-in.R @@ -1,11 +1,11 @@ - call( call( - call( -call( - call( - 2 - ) -) - ) + call( + call( + call( + call( + 2 + ) + ) + ) + ) ) - ) diff --git a/tests/testthat/indention_multiple/curly_and_round-in.R b/tests/testthat/indention_multiple/curly_and_round-in.R index 1643b4c2c..4ac773b0e 100644 --- a/tests/testthat/indention_multiple/curly_and_round-in.R +++ b/tests/testthat/indention_multiple/curly_and_round-in.R @@ -2,16 +2,13 @@ test_that("this is a text", { test(x, y, call(z)) }) -(({{ - call( - 12, 1 + 1, - 26) -}})) +(({{ call( + 12, 1 + 1, + 26 +) }})) -(({{ - call( - 12, 1 + 1, - 26 - ) -}})) +(({{ call( + 12, 1 + 1, + 26 +) }})) diff --git a/tests/testthat/indention_multiple/curly_and_round-out.R b/tests/testthat/indention_multiple/curly_and_round-out.R index f8a4acad2..4ac773b0e 100644 --- a/tests/testthat/indention_multiple/curly_and_round-out.R +++ b/tests/testthat/indention_multiple/curly_and_round-out.R @@ -2,21 +2,13 @@ test_that("this is a text", { test(x, y, call(z)) }) -(({ - { - call( - 12, 1 + 1, - 26 - ) - } -})) +(({{ call( + 12, 1 + 1, + 26 +) }})) -(({ - { - call( - 12, 1 + 1, - 26 - ) - } -})) +(({{ call( + 12, 1 + 1, + 26 +) }})) diff --git a/tests/testthat/indention_multiple/curly_only-in.R b/tests/testthat/indention_multiple/curly_only-in.R index b4ce37179..0934f4dca 100644 --- a/tests/testthat/indention_multiple/curly_only-in.R +++ b/tests/testthat/indention_multiple/curly_only-in.R @@ -1,13 +1,7 @@ - { - 1 + 1 - } - - {{{ -25 * 4 - }}} - -{ { - 1 + 142 * sin(pi) -} + 1 + 1 } + +{{{ 25 * 4 }}} + +{{ 1 + 142 * sin(pi) }} diff --git a/tests/testthat/indention_multiple/curly_only-out.R b/tests/testthat/indention_multiple/curly_only-out.R index a07a279b7..0934f4dca 100644 --- a/tests/testthat/indention_multiple/curly_only-out.R +++ b/tests/testthat/indention_multiple/curly_only-out.R @@ -2,16 +2,6 @@ 1 + 1 } -{ - { - { - 25 * 4 - } - } -} +{{{ 25 * 4 }}} -{ - { - 1 + 142 * sin(pi) - } -} +{{ 1 + 142 * sin(pi) }} diff --git a/tests/testthat/indention_multiple/edge_strict_mixed-in.R b/tests/testthat/indention_multiple/edge_strict_mixed-in.R index f4df9a0d6..ed0e5c86f 100644 --- a/tests/testthat/indention_multiple/edge_strict_mixed-in.R +++ b/tests/testthat/indention_multiple/edge_strict_mixed-in.R @@ -1,16 +1,13 @@ - { -( - (( -{{ +{ + ( + (( + {{{ c( + 99, + 1 + 1, { - c(99, - 1 + 1, - { - "within that suff" -}) + "within that suff" } - }} -)) + ) }}})) ) } diff --git a/tests/testthat/indention_multiple/edge_strict_mixed-out.R b/tests/testthat/indention_multiple/edge_strict_mixed-out.R index dcfe06a07..ed0e5c86f 100644 --- a/tests/testthat/indention_multiple/edge_strict_mixed-out.R +++ b/tests/testthat/indention_multiple/edge_strict_mixed-out.R @@ -1,19 +1,13 @@ { ( (( - { + {{{ c( + 99, + 1 + 1, { - { - c( - 99, - 1 + 1, - { - "within that suff" - } - ) - } + "within that suff" } - })) + ) }}})) ) } diff --git a/tests/testthat/indention_multiple/edge_strict_random-in.R b/tests/testthat/indention_multiple/edge_strict_random-in.R index 7ec47f29d..f39487b71 100644 --- a/tests/testthat/indention_multiple/edge_strict_random-in.R +++ b/tests/testthat/indention_multiple/edge_strict_random-in.R @@ -1,13 +1,13 @@ -{{( {{{{ {{{{ (( +{{ ({{{{{{{{ (( 19 -))}}}}}}}})}} +)) }}}}}}}}) }} - ( +( c("x", "y", "z", "sin(x)") - ) +) - { +{ c("x", "y", "z", "sin(x)") } diff --git a/tests/testthat/indention_multiple/edge_strict_random-out.R b/tests/testthat/indention_multiple/edge_strict_random-out.R index b91841440..f39487b71 100644 --- a/tests/testthat/indention_multiple/edge_strict_random-out.R +++ b/tests/testthat/indention_multiple/edge_strict_random-out.R @@ -1,26 +1,6 @@ -{ - { - ({ - { - { - { - { - { - { - { - (( - 19 - )) - } - } - } - } - } - } - } - }) - } -} +{{ ({{{{{{{{ (( + 19 +)) }}}}}}}}) }} ( diff --git a/tests/testthat/indention_multiple/fun_for_new_line-in.R b/tests/testthat/indention_multiple/fun_for_new_line-in.R index ff6e91449..f9c4e703e 100644 --- a/tests/testthat/indention_multiple/fun_for_new_line-in.R +++ b/tests/testthat/indention_multiple/fun_for_new_line-in.R @@ -1,7 +1,8 @@ -function() -NULL +function() { + NULL +} for (i in 1:3) - { -2 - } +{ + 2 +} diff --git a/tests/testthat/indention_multiple/if_else_curly-in.R b/tests/testthat/indention_multiple/if_else_curly-in.R index b08c1479e..697fed7e9 100644 --- a/tests/testthat/indention_multiple/if_else_curly-in.R +++ b/tests/testthat/indention_multiple/if_else_curly-in.R @@ -1,39 +1,40 @@ { - if (TRUE) -3 - else -4 + if (TRUE) { + 3 + } else { + 4 + } } { -if (TRUE) { - 3 - } else -4 + if (TRUE) { + 3 + } else { + 4 + } } { -if (TRUE) + if (TRUE) { 3 -else { - 4 -} + } else { + 4 + } } { -if (TRUE) { - 3 - } else { -4 -} + if (TRUE) { + 3 + } else { + 4 + } } # rather space than brace thing, but foo <- function(x) { if (TRUE) { 1 - } - else { + } else { 2 } } diff --git a/tests/testthat/indention_multiple/if_else_curly-out.R b/tests/testthat/indention_multiple/if_else_curly-out.R index c78a17731..697fed7e9 100644 --- a/tests/testthat/indention_multiple/if_else_curly-out.R +++ b/tests/testthat/indention_multiple/if_else_curly-out.R @@ -1,21 +1,23 @@ { - if (TRUE) + if (TRUE) { 3 - else + } else { 4 + } } { if (TRUE) { 3 - } else + } else { 4 + } } { - if (TRUE) + if (TRUE) { 3 - else { + } else { 4 } } diff --git a/tests/testthat/indention_multiple/overall-in.R b/tests/testthat/indention_multiple/overall-in.R index 6f9113e38..4db2b90fc 100644 --- a/tests/testthat/indention_multiple/overall-in.R +++ b/tests/testthat/indention_multiple/overall-in.R @@ -17,15 +17,17 @@ a <- function(x) { c( list(x + 2), c(c( - 26 ^ 2, + 26^2, 8, 7 - ))) + )) + ) call( 1, 2, 23 + Inf - 99, call( 16 - )) + ) + ) } # comments everywhere diff --git a/tests/testthat/indention_multiple/round_closing_on_same_line-in.R b/tests/testthat/indention_multiple/round_closing_on_same_line-in.R index 202426a69..52487327d 100644 --- a/tests/testthat/indention_multiple/round_closing_on_same_line-in.R +++ b/tests/testthat/indention_multiple/round_closing_on_same_line-in.R @@ -1,3 +1,4 @@ -c(call(2), 1, # comment -29 - ) +c( + call(2), 1, # comment + 29 +) diff --git a/tests/testthat/indention_multiple/round_only-in.R b/tests/testthat/indention_multiple/round_only-in.R index fa3a2f497..047992beb 100644 --- a/tests/testthat/indention_multiple/round_only-in.R +++ b/tests/testthat/indention_multiple/round_only-in.R @@ -1,7 +1,7 @@ ((((( -1 - ))))) + 1 +))))) - ((( -2 +((( + 2 ))) diff --git a/tests/testthat/indention_operators/base_pipe_and_assignment-in.R b/tests/testthat/indention_operators/base_pipe_and_assignment-in.R index b78d18d72..98fd88893 100644 --- a/tests/testthat/indention_operators/base_pipe_and_assignment-in.R +++ b/tests/testthat/indention_operators/base_pipe_and_assignment-in.R @@ -1,8 +1,8 @@ -a <- -b() |> +a <- + b() |> q() |> - g() + g() -a <- b() |> - c()|> -ggg() +a <- b() |> + c() |> + ggg() diff --git a/tests/testthat/indention_operators/base_pipe_and_assignment_and_comment-in.R b/tests/testthat/indention_operators/base_pipe_and_assignment_and_comment-in.R index 723de7160..4ebdd39b0 100644 --- a/tests/testthat/indention_operators/base_pipe_and_assignment_and_comment-in.R +++ b/tests/testthat/indention_operators/base_pipe_and_assignment_and_comment-in.R @@ -1,4 +1,4 @@ -a <-# +a <- # b() |> c() |> d() @@ -15,11 +15,11 @@ a <- d() a <- c |> - b()|> - c( ) |> + b() |> + c() |> d() a <- b() |> # c() |> - d()# d + d() # d diff --git a/tests/testthat/indention_operators/base_pipe_and_assignment_and_math-in.R b/tests/testthat/indention_operators/base_pipe_and_assignment_and_math-in.R index 53ad74073..c8ed58735 100644 --- a/tests/testthat/indention_operators/base_pipe_and_assignment_and_math-in.R +++ b/tests/testthat/indention_operators/base_pipe_and_assignment_and_math-in.R @@ -1,5 +1,5 @@ -q <- a+ - - 3 + -2+ -g()|> - k() +q <- a + + -3 + + 2 + + g() |> + k() diff --git a/tests/testthat/indention_operators/base_pipe_simple-in.R b/tests/testthat/indention_operators/base_pipe_simple-in.R index d52452414..4257a7917 100644 --- a/tests/testthat/indention_operators/base_pipe_simple-in.R +++ b/tests/testthat/indention_operators/base_pipe_simple-in.R @@ -1,18 +1,15 @@ - a |> -b() |> -c() |> - d(1 + e (sin(f))) |> - g_out() +a |> + b() |> + c() |> + d(1 + e(sin(f))) |> + g_out() a <- function(jon_the_pipe) {} x |> - # break call() y |> - - call() # mor diff --git a/tests/testthat/indention_operators/dollar_R6-in.R b/tests/testthat/indention_operators/dollar_R6-in.R index de575d6a5..e4cf03219 100644 --- a/tests/testthat/indention_operators/dollar_R6-in.R +++ b/tests/testthat/indention_operators/dollar_R6-in.R @@ -1,4 +1,4 @@ - x$ - add(10) $ -add(10)$sum + -3 +x$ + add(10)$ + add(10)$sum + + 3 diff --git a/tests/testthat/indention_operators/eq_assign-in.R b/tests/testthat/indention_operators/eq_assign-in.R index d7659259c..f3853d96f 100644 --- a/tests/testthat/indention_operators/eq_assign-in.R +++ b/tests/testthat/indention_operators/eq_assign-in.R @@ -1,12 +1,13 @@ switch(engine, - pdftex = { - if (any) { - x - } - }, - new=( - 2 - ) ) + pdftex = { + if (any) { + x + } + }, + new = ( + 2 + ) +) { a <- diff --git a/tests/testthat/indention_operators/eq_formal_simple-in.R b/tests/testthat/indention_operators/eq_formal_simple-in.R index 5c799d1cc..01554a116 100644 --- a/tests/testthat/indention_operators/eq_formal_simple-in.R +++ b/tests/testthat/indention_operators/eq_formal_simple-in.R @@ -1,6 +1,5 @@ abbbb <- function(x = - 22 - ) { + 22) { data_frame( x = long_long_long * x diff --git a/tests/testthat/indention_operators/eq_formals_complex_indention-in.R b/tests/testthat/indention_operators/eq_formals_complex_indention-in.R index 0710288de..14e85ed8f 100644 --- a/tests/testthat/indention_operators/eq_formals_complex_indention-in.R +++ b/tests/testthat/indention_operators/eq_formals_complex_indention-in.R @@ -1,27 +1,24 @@ function(a = -33, - b - ) {} + 33, + b) {} function(a = - 33, - b ) {} + 33, + b) {} -function(a , - b, -c - ) {} +function(a, + b, + c) {} function(a, - b, -c) {} + b, + c) {} function(ss, - a = -3, - er = - 4 - ) {} + a = + 3, + er = + 4) {} function(a = b, diff --git a/tests/testthat/indention_operators/eq_formals_complex_indention-out.R b/tests/testthat/indention_operators/eq_formals_complex_indention-out.R index 9cf7cbbed..14e85ed8f 100644 --- a/tests/testthat/indention_operators/eq_formals_complex_indention-out.R +++ b/tests/testthat/indention_operators/eq_formals_complex_indention-out.R @@ -1,7 +1,6 @@ function(a = 33, - b -) {} + b) {} function(a = 33, @@ -9,8 +8,7 @@ function(a = function(a, b, - c -) {} + c) {} function(a, b, @@ -20,8 +18,7 @@ function(ss, a = 3, er = - 4 -) {} + 4) {} function(a = b, diff --git a/tests/testthat/indention_operators/eq_formals_complex_tokens-in.R b/tests/testthat/indention_operators/eq_formals_complex_tokens-in.R index 0710288de..14e85ed8f 100644 --- a/tests/testthat/indention_operators/eq_formals_complex_tokens-in.R +++ b/tests/testthat/indention_operators/eq_formals_complex_tokens-in.R @@ -1,27 +1,24 @@ function(a = -33, - b - ) {} + 33, + b) {} function(a = - 33, - b ) {} + 33, + b) {} -function(a , - b, -c - ) {} +function(a, + b, + c) {} function(a, - b, -c) {} + b, + c) {} function(ss, - a = -3, - er = - 4 - ) {} + a = + 3, + er = + 4) {} function(a = b, diff --git a/tests/testthat/indention_operators/eq_sub_complex_indention-in.R b/tests/testthat/indention_operators/eq_sub_complex_indention-in.R index b2e301665..b29f2e9d9 100644 --- a/tests/testthat/indention_operators/eq_sub_complex_indention-in.R +++ b/tests/testthat/indention_operators/eq_sub_complex_indention-in.R @@ -1,32 +1,34 @@ -call(a = - 5, - b) +call( + a = + 5, + b +) -call(a = - 5, - b - ) +call( + a = + 5, + b +) # multiple nested levels { v <- function(x = - 122, - y) { - } + 122, + y) { + } } { - v <- function(x = 122, - y) { - } + v <- function(x = 122, + y) { + } } MyClass <- R6::R6Class( - "MyClass", - public = list(initialize = function(my_arg, - my_named_arg = 1) { - return(invisible()) - } - ), + "MyClass", + public = list(initialize = function(my_arg, + my_named_arg = 1) { + return(invisible()) + }), ) diff --git a/tests/testthat/indention_operators/eq_sub_complex_indention-out.R b/tests/testthat/indention_operators/eq_sub_complex_indention-out.R index 34e4f8687..b29f2e9d9 100644 --- a/tests/testthat/indention_operators/eq_sub_complex_indention-out.R +++ b/tests/testthat/indention_operators/eq_sub_complex_indention-out.R @@ -1,10 +1,13 @@ -call(a = - 5, -b) +call( + a = + 5, + b +) -call(a = - 5, -b +call( + a = + 5, + b ) # multiple nested levels @@ -27,6 +30,5 @@ MyClass <- R6::R6Class( public = list(initialize = function(my_arg, my_named_arg = 1) { return(invisible()) - } - ), + }), ) diff --git a/tests/testthat/indention_operators/eq_sub_complex_tokens-in.R b/tests/testthat/indention_operators/eq_sub_complex_tokens-in.R index 739c340c8..717a8a610 100644 --- a/tests/testthat/indention_operators/eq_sub_complex_tokens-in.R +++ b/tests/testthat/indention_operators/eq_sub_complex_tokens-in.R @@ -1,15 +1,18 @@ -call(a = - 5, - b) +call( + a = + 5, + b +) -call(a = - 5, - b - ) +call( + a = + 5, + b +) c( - a = - 1, - b = # comment here - 2 + a = + 1, + b = # comment here + 2 ) diff --git a/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-in.R b/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-in.R index 79d9acb95..d4ed77f59 100644 --- a/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-in.R +++ b/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-in.R @@ -1,26 +1,38 @@ -g <- function(k) +g <- function(k) { NULL - - -g <- function(k) h( - NULL -) - - -g <- function(k) h( # y - NULL # x -) - -g <- function(k) h( # y - NULL -) - - -g <- function(k) h( - NULL # 3jkö -) - -g <- function(k) h( - if (TRUE) - x -) +} + + +g <- function(k) { + h( + NULL + ) +} + + +g <- function(k) { + h( # y + NULL # x + ) +} + +g <- function(k) { + h( # y + NULL + ) +} + + +g <- function(k) { + h( + NULL # 3jkö + ) +} + +g <- function(k) { + h( + if (TRUE) { + x + } + ) +} diff --git a/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-out.R b/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-out.R index 79d9acb95..d4ed77f59 100644 --- a/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-out.R +++ b/tests/testthat/indention_operators/function-multiline-no-braces-non-strict-out.R @@ -1,26 +1,38 @@ -g <- function(k) +g <- function(k) { NULL - - -g <- function(k) h( - NULL -) - - -g <- function(k) h( # y - NULL # x -) - -g <- function(k) h( # y - NULL -) - - -g <- function(k) h( - NULL # 3jkö -) - -g <- function(k) h( - if (TRUE) - x -) +} + + +g <- function(k) { + h( + NULL + ) +} + + +g <- function(k) { + h( # y + NULL # x + ) +} + +g <- function(k) { + h( # y + NULL + ) +} + + +g <- function(k) { + h( + NULL # 3jkö + ) +} + +g <- function(k) { + h( + if (TRUE) { + x + } + ) +} diff --git a/tests/testthat/indention_operators/function-multiline-no-braces-strict-in.R b/tests/testthat/indention_operators/function-multiline-no-braces-strict-in.R index 79d9acb95..d4ed77f59 100644 --- a/tests/testthat/indention_operators/function-multiline-no-braces-strict-in.R +++ b/tests/testthat/indention_operators/function-multiline-no-braces-strict-in.R @@ -1,26 +1,38 @@ -g <- function(k) +g <- function(k) { NULL - - -g <- function(k) h( - NULL -) - - -g <- function(k) h( # y - NULL # x -) - -g <- function(k) h( # y - NULL -) - - -g <- function(k) h( - NULL # 3jkö -) - -g <- function(k) h( - if (TRUE) - x -) +} + + +g <- function(k) { + h( + NULL + ) +} + + +g <- function(k) { + h( # y + NULL # x + ) +} + +g <- function(k) { + h( # y + NULL + ) +} + + +g <- function(k) { + h( + NULL # 3jkö + ) +} + +g <- function(k) { + h( + if (TRUE) { + x + } + ) +} diff --git a/tests/testthat/indention_operators/if-else-no-braces-not-strict-in.R b/tests/testthat/indention_operators/if-else-no-braces-not-strict-in.R index acddf4348..9d63984f2 100644 --- a/tests/testthat/indention_operators/if-else-no-braces-not-strict-in.R +++ b/tests/testthat/indention_operators/if-else-no-braces-not-strict-in.R @@ -1,17 +1,29 @@ -if (TRUE) c( - 2 -) else c( - 1 -) +if (TRUE) { + c( + 2 + ) +} else { + c( + 1 + ) +} -if (TRUE) c( - 2 -) else c( # nothing - 1 -) +if (TRUE) { + c( + 2 + ) +} else { + c( # nothing + 1 + ) +} -if (TRUE) c( - 2 # also nothing -) else c( - 1 -) +if (TRUE) { + c( + 2 # also nothing + ) +} else { + c( + 1 + ) +} diff --git a/tests/testthat/indention_operators/if-else-no-braces-not-strict-out.R b/tests/testthat/indention_operators/if-else-no-braces-not-strict-out.R index acddf4348..9d63984f2 100644 --- a/tests/testthat/indention_operators/if-else-no-braces-not-strict-out.R +++ b/tests/testthat/indention_operators/if-else-no-braces-not-strict-out.R @@ -1,17 +1,29 @@ -if (TRUE) c( - 2 -) else c( - 1 -) +if (TRUE) { + c( + 2 + ) +} else { + c( + 1 + ) +} -if (TRUE) c( - 2 -) else c( # nothing - 1 -) +if (TRUE) { + c( + 2 + ) +} else { + c( # nothing + 1 + ) +} -if (TRUE) c( - 2 # also nothing -) else c( - 1 -) +if (TRUE) { + c( + 2 # also nothing + ) +} else { + c( + 1 + ) +} diff --git a/tests/testthat/indention_operators/logical_special_eq_sub-in.R b/tests/testthat/indention_operators/logical_special_eq_sub-in.R index 9f80a11aa..3dc9435dd 100644 --- a/tests/testthat/indention_operators/logical_special_eq_sub-in.R +++ b/tests/testthat/indention_operators/logical_special_eq_sub-in.R @@ -1,18 +1,18 @@ a || -b + b - a > -4 +a > + 4 -a& -3 +a & + 3 b %in% - c + c data_frame( -a = - list() - ) -b = -3 + a = + list() +) +b <- + 3 diff --git a/tests/testthat/indention_operators/logical_special_eq_sub-out.R b/tests/testthat/indention_operators/logical_special_eq_sub-out.R index 2971b154b..3dc9435dd 100644 --- a/tests/testthat/indention_operators/logical_special_eq_sub-out.R +++ b/tests/testthat/indention_operators/logical_special_eq_sub-out.R @@ -14,5 +14,5 @@ data_frame( a = list() ) -b = +b <- 3 diff --git a/tests/testthat/indention_operators/mixed-in.R b/tests/testthat/indention_operators/mixed-in.R index aeb51e145..81c2efe30 100644 --- a/tests/testthat/indention_operators/mixed-in.R +++ b/tests/testthat/indention_operators/mixed-in.R @@ -1,11 +1,11 @@ 1 + -2 + - 3 + 2 + + 3 1 + -2/ - 3 + 2 / + 3 - 1 / -2 + -4 +1 / + 2 + + 4 diff --git a/tests/testthat/indention_operators/mixed-out.R b/tests/testthat/indention_operators/mixed-out.R index 38ea020a7..81c2efe30 100644 --- a/tests/testthat/indention_operators/mixed-out.R +++ b/tests/testthat/indention_operators/mixed-out.R @@ -4,7 +4,7 @@ 1 + 2 / - 3 + 3 1 / 2 + diff --git a/tests/testthat/indention_operators/multiply_divide-in.R b/tests/testthat/indention_operators/multiply_divide-in.R index 4eb37ba1b..c623d698b 100644 --- a/tests/testthat/indention_operators/multiply_divide-in.R +++ b/tests/testthat/indention_operators/multiply_divide-in.R @@ -1,8 +1,8 @@ - 1 / -2 + 3 * -17 * -22222 / - 19 * - -1 +1 / + 2 + 3 * + 17 * + 22222 / + 19 * + -1 - 3 * 22 +3 * 22 diff --git a/tests/testthat/indention_operators/nested-for-spacing-scope-indention-in.R b/tests/testthat/indention_operators/nested-for-spacing-scope-indention-in.R index 24b939fd5..4ae05b086 100644 --- a/tests/testthat/indention_operators/nested-for-spacing-scope-indention-in.R +++ b/tests/testthat/indention_operators/nested-for-spacing-scope-indention-in.R @@ -1,11 +1,13 @@ -for (x in 1){ -x -for (x in k ) -3 +for (x in 1) { + x + for (x in k) { + 3 + } } for (x in 1) { x - for (x in k ) - 3 + for (x in k) { + 3 + } } diff --git a/tests/testthat/indention_operators/nested-for-spacing-scope-indention-out.R b/tests/testthat/indention_operators/nested-for-spacing-scope-indention-out.R index 585942ace..4ae05b086 100644 --- a/tests/testthat/indention_operators/nested-for-spacing-scope-indention-out.R +++ b/tests/testthat/indention_operators/nested-for-spacing-scope-indention-out.R @@ -1,11 +1,13 @@ for (x in 1) { x - for (x in k) + for (x in k) { 3 + } } for (x in 1) { x - for (x in k) + for (x in k) { 3 + } } diff --git a/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-in.R b/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-in.R index 8e33e7295..4ae05b086 100644 --- a/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-in.R +++ b/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-in.R @@ -1,11 +1,13 @@ for (x in 1) { x - for (x in k ) + for (x in k) { 3 + } } for (x in 1) { x - for (x in k ) - 3 + for (x in k) { + 3 + } } diff --git a/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-out.R b/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-out.R index 4016945fe..4ae05b086 100644 --- a/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-out.R +++ b/tests/testthat/indention_operators/nested-for-spacing-scope-spaces-out.R @@ -1,11 +1,13 @@ for (x in 1) { x - for (x in k) + for (x in k) { 3 + } } for (x in 1) { x - for (x in k) - 3 + for (x in k) { + 3 + } } diff --git a/tests/testthat/indention_operators/not_first_trigger-in.R b/tests/testthat/indention_operators/not_first_trigger-in.R index 0c82031d5..c5569c8ce 100644 --- a/tests/testthat/indention_operators/not_first_trigger-in.R +++ b/tests/testthat/indention_operators/not_first_trigger-in.R @@ -1,17 +1,19 @@ -1+ ( +1 + ( 3 ) %>% -j() + j() -a <- c(x, y, - z) %>% -k() +a <- c( + x, y, + z +) %>% + k() a + ( c -) + ( - c( - 2 - ) -)%>% -j() +) + ( + c( + 2 + ) +) %>% + j() diff --git a/tests/testthat/indention_operators/overall-in.R b/tests/testthat/indention_operators/overall-in.R index f0d703c6d..04b16ba30 100644 --- a/tests/testthat/indention_operators/overall-in.R +++ b/tests/testthat/indention_operators/overall-in.R @@ -1,19 +1,19 @@ -pd%>% -mutate(x =devide(call3(a, b, 1 + q))) %>% - filter( !terminal) %>% - ggplot(aes(x = new, y = old))+ -geom_point() +pd %>% + mutate(x = devide(call3(a, b, 1 + q))) %>% + filter(!terminal) %>% + ggplot(aes(x = new, y = old)) + + geom_point() -1+( -22- (1/ - 2718 / - 23* 29 * ( - 2 * (22*-1) + - 1) - - 18) + - sin( pi) - -2 - ) +1 + ( + 22 - (1 / + 2718 / + 23 * 29 * ( + 2 * (22 * -1) + + 1) - + 18) + + sin(pi) - + 2 +) a <- function(z) { a %>% @@ -21,7 +21,7 @@ a <- function(z) { n() } - a %>% -b()%>% -c()%>% -k() +a %>% + b() %>% + c() %>% + k() diff --git a/tests/testthat/indention_operators/pipe_and_assignment-in.R b/tests/testthat/indention_operators/pipe_and_assignment-in.R index e6cbe6e92..de72fdec5 100644 --- a/tests/testthat/indention_operators/pipe_and_assignment-in.R +++ b/tests/testthat/indention_operators/pipe_and_assignment-in.R @@ -1,8 +1,8 @@ -a <- -b() %>% +a <- + b() %>% q() %>% - g() + g() -a <- b() %>% - c()%>% -ggg() +a <- b() %>% + c() %>% + ggg() diff --git a/tests/testthat/indention_operators/pipe_and_assignment_and_comment-in.R b/tests/testthat/indention_operators/pipe_and_assignment_and_comment-in.R index ab24b9e47..4a8a97ac6 100644 --- a/tests/testthat/indention_operators/pipe_and_assignment_and_comment-in.R +++ b/tests/testthat/indention_operators/pipe_and_assignment_and_comment-in.R @@ -1,4 +1,4 @@ -a <-# +a <- # b() %>% c() %>% d() @@ -15,11 +15,11 @@ a <- d() a <- c %>% - b()%>% - c( ) %>% + b() %>% + c() %>% d() a <- b() %>% # c() %>% - d()# d + d() # d diff --git a/tests/testthat/indention_operators/pipe_and_assignment_and_math-in.R b/tests/testthat/indention_operators/pipe_and_assignment_and_math-in.R index 4005fce03..172735d82 100644 --- a/tests/testthat/indention_operators/pipe_and_assignment_and_math-in.R +++ b/tests/testthat/indention_operators/pipe_and_assignment_and_math-in.R @@ -1,5 +1,5 @@ -q <- a+ - - 3 + -2+ -g()%>% - k() +q <- a + + -3 + + 2 + + g() %>% + k() diff --git a/tests/testthat/indention_operators/pipe_simple-in.R b/tests/testthat/indention_operators/pipe_simple-in.R index fe3cd3535..bb3ff2a43 100644 --- a/tests/testthat/indention_operators/pipe_simple-in.R +++ b/tests/testthat/indention_operators/pipe_simple-in.R @@ -1,18 +1,15 @@ - a %>% -b() %>% -c() %>% - d(1 + e (sin(f))) %>% - g_out() +a %>% + b() %>% + c() %>% + d(1 + e(sin(f))) %>% + g_out() a <- function(jon_the_pipe) {} x %>% - # break call() y %>% - - call() # mor diff --git a/tests/testthat/indention_operators/plus_minus-in.R b/tests/testthat/indention_operators/plus_minus-in.R index 079b0918f..936dc75e4 100644 --- a/tests/testthat/indention_operators/plus_minus-in.R +++ b/tests/testthat/indention_operators/plus_minus-in.R @@ -1,7 +1,7 @@ 1 + - 2 + -3 + - 4 - + 2 + + 3 + + 4 - 5 1 + 1 diff --git a/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-in.R b/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-in.R index 43f1cd48e..e759975fc 100644 --- a/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-in.R +++ b/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-in.R @@ -1,61 +1,75 @@ -while (x > 3) +while (x > 3) { return(FALSE) +} -for (i in 1:3) +for (i in 1:3) { print(i) +} -if (x) +if (x) { call2(3) +} -for (i in 1:3) # +for (i in 1:3) { # print(i) +} for (i in - 1:3) # + 1:3) { # print(i) +} for (i in # - 1:3) # + 1:3) { # print(i) +} -for (# +for ( # i in # - 1:3# -) # + 1:3 # +) { # print(i) +} -while (x > 3) # +while (x > 3) { # return(FALSE) +} while (x > 3 # -) +) { return(FALSE) +} while ( # test - x > 3) # another + x > 3) { # another return(FALSE) +} while ( - 2 > #here - 3 # -) # + 2 > # here + 3 # +) { # FALSE +} while ( - 2 > #here - 3 # -) + 2 > # here + 3 # +) { FALSE +} while ( - 2 > #here - 3 -) # + 2 > # here + 3 +) { # FALSE +} -while (# +while ( # 2 > - 3 -) # + 3 +) { # FALSE +} diff --git a/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-out.R b/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-out.R index 00490d0db..e759975fc 100644 --- a/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-out.R +++ b/tests/testthat/indention_operators/while_for_if_without_curly_non_strict-out.R @@ -1,61 +1,75 @@ -while (x > 3) +while (x > 3) { return(FALSE) +} -for (i in 1:3) +for (i in 1:3) { print(i) +} -if (x) +if (x) { call2(3) +} -for (i in 1:3) # +for (i in 1:3) { # print(i) +} for (i in - 1:3) # + 1:3) { # print(i) +} for (i in # - 1:3) # + 1:3) { # print(i) +} for ( # i in # 1:3 # -) # +) { # print(i) +} -while (x > 3) # +while (x > 3) { # return(FALSE) +} while (x > 3 # -) +) { return(FALSE) +} while ( # test - x > 3) # another + x > 3) { # another return(FALSE) +} while ( 2 > # here 3 # -) # +) { # FALSE +} while ( 2 > # here 3 # -) +) { FALSE +} while ( 2 > # here 3 -) # +) { # FALSE +} while ( # 2 > 3 -) # +) { # FALSE +} diff --git a/tests/testthat/indention_operators/while_for_if_without_curly_strict-in.R b/tests/testthat/indention_operators/while_for_if_without_curly_strict-in.R index 3bda095e9..e759975fc 100644 --- a/tests/testthat/indention_operators/while_for_if_without_curly_strict-in.R +++ b/tests/testthat/indention_operators/while_for_if_without_curly_strict-in.R @@ -1,61 +1,75 @@ -while (x > 3) -return(FALSE) +while (x > 3) { + return(FALSE) +} -for (i in 1:3) -print(i) +for (i in 1:3) { + print(i) +} -if (x) -call2(3) +if (x) { + call2(3) +} -for (i in 1:3) # +for (i in 1:3) { # print(i) +} for (i in - 1:3) # + 1:3) { # print(i) +} for (i in # - 1:3) # + 1:3) { # print(i) +} -for (# +for ( # i in # - 1:3# - ) # + 1:3 # +) { # print(i) +} -while (x > 3) # +while (x > 3) { # return(FALSE) +} while (x > 3 # - ) +) { return(FALSE) +} while ( # test - x > 3) # another + x > 3) { # another return(FALSE) +} while ( - 2 > #here - 3 # - ) # + 2 > # here + 3 # +) { # FALSE +} while ( - 2 > #here - 3 # -) + 2 > # here + 3 # +) { FALSE +} while ( - 2 > #here - 3 -) # + 2 > # here + 3 +) { # FALSE +} -while (# +while ( # 2 > - 3 -) # + 3 +) { # FALSE +} diff --git a/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-in.R b/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-in.R index b26d46bc8..8847b05c2 100644 --- a/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-in.R +++ b/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-in.R @@ -1,31 +1,45 @@ -while(x == 2) h( - 2 -) +while (x == 2) { + h( + 2 + ) +} -while(x == 2) h( # comment - 2 -) +while (x == 2) { + h( # comment + 2 + ) +} -while(x == 2 && - 2 + 2 == 2) h( - 2 -) +while (x == 2 && + 2 + 2 == 2) { + h( + 2 + ) +} -for(x in 1:22) h( - 2 -) +for (x in 1:22) { + h( + 2 + ) +} -for(x in 1:22) h( # comment - 2 -) +for (x in 1:22) { + h( # comment + 2 + ) +} -for(k in f( +for (k in f( 2:22 -)) h( - 2 - ) +)) { + h( + 2 + ) +} -for(k in f( +for (k in f( 2:22 # comment -)) h(2) +)) { + h(2) +} diff --git a/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-out.R b/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-out.R index 7342282c8..8847b05c2 100644 --- a/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-out.R +++ b/tests/testthat/indention_operators/while_for_without_curly_same_line_non_strict-out.R @@ -1,31 +1,45 @@ -while (x == 2) h( - 2 -) +while (x == 2) { + h( + 2 + ) +} -while (x == 2) h( # comment - 2 -) +while (x == 2) { + h( # comment + 2 + ) +} while (x == 2 && - 2 + 2 == 2) h( - 2 -) + 2 + 2 == 2) { + h( + 2 + ) +} -for (x in 1:22) h( - 2 -) +for (x in 1:22) { + h( + 2 + ) +} -for (x in 1:22) h( # comment - 2 -) +for (x in 1:22) { + h( # comment + 2 + ) +} for (k in f( 2:22 -)) h( - 2 -) +)) { + h( + 2 + ) +} for (k in f( 2:22 # comment -)) h(2) +)) { + h(2) +} diff --git a/tests/testthat/indention_round_brackets/arithmetic_no_start-in.R b/tests/testthat/indention_round_brackets/arithmetic_no_start-in.R index 01e7fb8e3..99760e3af 100644 --- a/tests/testthat/indention_round_brackets/arithmetic_no_start-in.R +++ b/tests/testthat/indention_round_brackets/arithmetic_no_start-in.R @@ -1,3 +1,3 @@ 1 + - 2 + ( -3 + 4) + 2 + ( + 3 + 4) diff --git a/tests/testthat/indention_round_brackets/arithmetic_start-in.R b/tests/testthat/indention_round_brackets/arithmetic_start-in.R index d8ef4066c..ec2ff7135 100644 --- a/tests/testthat/indention_round_brackets/arithmetic_start-in.R +++ b/tests/testthat/indention_round_brackets/arithmetic_start-in.R @@ -1,5 +1,5 @@ - (1 + -2 + ( -3 + 4 +(1 + + 2 + ( + 3 + 4 ) ) diff --git a/tests/testthat/indention_round_brackets/multi_line-no-indention-in.R b/tests/testthat/indention_round_brackets/multi_line-no-indention-in.R index 740442132..e960a3d0d 100644 --- a/tests/testthat/indention_round_brackets/multi_line-no-indention-in.R +++ b/tests/testthat/indention_round_brackets/multi_line-no-indention-in.R @@ -1,9 +1,9 @@ call( -1, -call2( -2, 3, -call3(1, 2, 22), -5 -), -144 + 1, + call2( + 2, 3, + call3(1, 2, 22), + 5 + ), + 144 ) diff --git a/tests/testthat/indention_round_brackets/multi_line-random-in.R b/tests/testthat/indention_round_brackets/multi_line-random-in.R index 15c35f66c..e960a3d0d 100644 --- a/tests/testthat/indention_round_brackets/multi_line-random-in.R +++ b/tests/testthat/indention_round_brackets/multi_line-random-in.R @@ -1,9 +1,9 @@ call( -1, + 1, call2( 2, 3, -call3(1, 2, 22), - 5 + call3(1, 2, 22), + 5 ), 144 - ) +) diff --git a/tests/testthat/indention_round_brackets/one_line-in.R b/tests/testthat/indention_round_brackets/one_line-in.R index 1b25efbeb..1f0bb9616 100644 --- a/tests/testthat/indention_round_brackets/one_line-in.R +++ b/tests/testthat/indention_round_brackets/one_line-in.R @@ -1 +1 @@ -a <- xyz(x, 22, if(x > 1) 33 else 4) +a <- xyz(x, 22, if (x > 1) 33 else 4) diff --git a/tests/testthat/indention_round_brackets/one_line-nested-in.R b/tests/testthat/indention_round_brackets/one_line-nested-in.R index 1b25efbeb..1f0bb9616 100644 --- a/tests/testthat/indention_round_brackets/one_line-nested-in.R +++ b/tests/testthat/indention_round_brackets/one_line-nested-in.R @@ -1 +1 @@ -a <- xyz(x, 22, if(x > 1) 33 else 4) +a <- xyz(x, 22, if (x > 1) 33 else 4) diff --git a/tests/testthat/indention_square_brackets/square_brackets_line_break-in.R b/tests/testthat/indention_square_brackets/square_brackets_line_break-in.R index 6dd33a894..ae6be434b 100644 --- a/tests/testthat/indention_square_brackets/square_brackets_line_break-in.R +++ b/tests/testthat/indention_square_brackets/square_brackets_line_break-in.R @@ -1,46 +1,50 @@ -ranges[tag == "non_literal" & str_detect(text, ";"), -text := str_replace_all(text, ";", "\n")] +ranges[ + tag == "non_literal" & str_detect(text, ";"), + text := str_replace_all(text, ";", "\n") +] fak[a, b] -fac[a, - b] - fac[ a, b - ] +] fac[ - , `:`(a = b)] + a, + b +] fac[ , `:`(a = b) ] -fac[, `:`(a = c) +fac[ + , `:`(a = b) ] -x[a ==3 | - b == v,] +fac[, `:`(a = c)] + +x[a == 3 | + b == v, ] -x[a ==3 - | b == v,] +x[a == 3 | + b == v, ] -x[a ==3 || - b == v,] +x[a == 3 || + b == v, ] -x[a ==3 - || b == v,] +x[a == 3 || + b == v, ] -x[a ==3 - && b == v,] +x[a == 3 && + b == v, ] -x[a ==3 - & b == v,] +x[a == 3 & + b == v, ] -x[a ==3 && - b == v,] +x[a == 3 && + b == v, ] -x[a ==3 & - b == v,] +x[a == 3 & + b == v, ] diff --git a/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-in.R b/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-in.R index 7699633d2..e20e8c9c8 100644 --- a/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-in.R +++ b/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-in.R @@ -1,40 +1,77 @@ -if(TRUE)NULL else if(FALSE)NULL else NULL +if (TRUE) NULL else if (FALSE) NULL else NULL -if(TRUE)NULL else if(FALSE)NULL else NULL # comment +if (TRUE) NULL else if (FALSE) NULL else NULL # comment -if(TRUE)NULL else if(FALSE)NULL else # comment - NULL +if (TRUE) { + NULL +} else if (FALSE) { + NULL +} else { # comment + NULL +} # if(TRUE)NULL else if(FALSE)NULL # comment # else NULL -if(TRUE)NULL else if(FALSE) # comment -NULL else NULL +if (TRUE) { + NULL +} else if (FALSE) { # comment + NULL +} else { + NULL +} -if(TRUE)NULL else if(FALSE # comment -)NULL else NULL +if (TRUE) { + NULL +} else if (FALSE # comment +) { + NULL +} else { + NULL +} -if(TRUE)NULL else if( # comment -FALSE)NULL else NULL +if (TRUE) { + NULL +} else if ( # comment + FALSE) { + NULL +} else { + NULL +} -if(TRUE)NULL else if # comment -(FALSE)NULL else NULL +if (TRUE) { + NULL +} else if # comment +(FALSE) { + NULL +} else { + NULL +} -if(TRUE)NULL else # comment - if(FALSE)NULL else NULL +if (TRUE) { + NULL +} else # comment +if (FALSE) NULL else NULL # if(TRUE)NULL # comment # else if(FALSE)NULL else NULL -if(TRUE) # comment -NULL else if(FALSE)NULL else NULL +if (TRUE) { # comment + NULL +} else if (FALSE) NULL else NULL -if(TRUE # comment -)NULL else if(FALSE)NULL else NULL +if (TRUE # comment +) { + NULL +} else if (FALSE) NULL else NULL -if( # comment -TRUE)NULL else if(FALSE)NULL else NULL +if ( # comment + TRUE) { + NULL +} else if (FALSE) NULL else NULL if # comment -(TRUE)NULL else if(FALSE)NULL else NULL +(TRUE) { + NULL +} else if (FALSE) NULL else NULL diff --git a/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-out.R b/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-out.R index b1cbc8852..e20e8c9c8 100644 --- a/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-out.R +++ b/tests/testthat/insertion_comment_interaction/if_else_if_else_non_strict-out.R @@ -3,38 +3,75 @@ if (TRUE) NULL else if (FALSE) NULL else NULL if (TRUE) NULL else if (FALSE) NULL else NULL # comment -if (TRUE) NULL else if (FALSE) NULL else # comment +if (TRUE) { NULL +} else if (FALSE) { + NULL +} else { # comment + NULL +} # if(TRUE)NULL else if(FALSE)NULL # comment # else NULL -if (TRUE) NULL else if (FALSE) # comment - NULL else NULL +if (TRUE) { + NULL +} else if (FALSE) { # comment + NULL +} else { + NULL +} -if (TRUE) NULL else if (FALSE # comment -) NULL else NULL +if (TRUE) { + NULL +} else if (FALSE # comment +) { + NULL +} else { + NULL +} -if (TRUE) NULL else if ( # comment - FALSE) NULL else NULL +if (TRUE) { + NULL +} else if ( # comment + FALSE) { + NULL +} else { + NULL +} -if (TRUE) NULL else if # comment -(FALSE) NULL else NULL +if (TRUE) { + NULL +} else if # comment +(FALSE) { + NULL +} else { + NULL +} -if (TRUE) NULL else # comment +if (TRUE) { + NULL +} else # comment if (FALSE) NULL else NULL # if(TRUE)NULL # comment # else if(FALSE)NULL else NULL -if (TRUE) # comment - NULL else if (FALSE) NULL else NULL +if (TRUE) { # comment + NULL +} else if (FALSE) NULL else NULL if (TRUE # comment -) NULL else if (FALSE) NULL else NULL +) { + NULL +} else if (FALSE) NULL else NULL if ( # comment - TRUE) NULL else if (FALSE) NULL else NULL + TRUE) { + NULL +} else if (FALSE) NULL else NULL if # comment -(TRUE) NULL else if (FALSE) NULL else NULL +(TRUE) { + NULL +} else if (FALSE) NULL else NULL diff --git a/tests/testthat/insertion_comment_interaction/if_else_if_else_strict-in.R b/tests/testthat/insertion_comment_interaction/if_else_if_else_strict-in.R index 7699633d2..e20e8c9c8 100644 --- a/tests/testthat/insertion_comment_interaction/if_else_if_else_strict-in.R +++ b/tests/testthat/insertion_comment_interaction/if_else_if_else_strict-in.R @@ -1,40 +1,77 @@ -if(TRUE)NULL else if(FALSE)NULL else NULL +if (TRUE) NULL else if (FALSE) NULL else NULL -if(TRUE)NULL else if(FALSE)NULL else NULL # comment +if (TRUE) NULL else if (FALSE) NULL else NULL # comment -if(TRUE)NULL else if(FALSE)NULL else # comment - NULL +if (TRUE) { + NULL +} else if (FALSE) { + NULL +} else { # comment + NULL +} # if(TRUE)NULL else if(FALSE)NULL # comment # else NULL -if(TRUE)NULL else if(FALSE) # comment -NULL else NULL +if (TRUE) { + NULL +} else if (FALSE) { # comment + NULL +} else { + NULL +} -if(TRUE)NULL else if(FALSE # comment -)NULL else NULL +if (TRUE) { + NULL +} else if (FALSE # comment +) { + NULL +} else { + NULL +} -if(TRUE)NULL else if( # comment -FALSE)NULL else NULL +if (TRUE) { + NULL +} else if ( # comment + FALSE) { + NULL +} else { + NULL +} -if(TRUE)NULL else if # comment -(FALSE)NULL else NULL +if (TRUE) { + NULL +} else if # comment +(FALSE) { + NULL +} else { + NULL +} -if(TRUE)NULL else # comment - if(FALSE)NULL else NULL +if (TRUE) { + NULL +} else # comment +if (FALSE) NULL else NULL # if(TRUE)NULL # comment # else if(FALSE)NULL else NULL -if(TRUE) # comment -NULL else if(FALSE)NULL else NULL +if (TRUE) { # comment + NULL +} else if (FALSE) NULL else NULL -if(TRUE # comment -)NULL else if(FALSE)NULL else NULL +if (TRUE # comment +) { + NULL +} else if (FALSE) NULL else NULL -if( # comment -TRUE)NULL else if(FALSE)NULL else NULL +if ( # comment + TRUE) { + NULL +} else if (FALSE) NULL else NULL if # comment -(TRUE)NULL else if(FALSE)NULL else NULL +(TRUE) { + NULL +} else if (FALSE) NULL else NULL diff --git a/tests/testthat/insertion_comment_interaction/if_else_non_strict-in.R b/tests/testthat/insertion_comment_interaction/if_else_non_strict-in.R index 1b310f6be..27af5497e 100644 --- a/tests/testthat/insertion_comment_interaction/if_else_non_strict-in.R +++ b/tests/testthat/insertion_comment_interaction/if_else_non_strict-in.R @@ -1,22 +1,40 @@ -if(TRUE)NULL else NULL +if (TRUE) NULL else NULL -if(TRUE)NULL else NULL # comment +if (TRUE) NULL else NULL # comment -if(TRUE)NULL else # comment - NULL +if (TRUE) { + NULL +} else { # comment + NULL +} # if(TRUE)NULL # comment # else NULL -if(TRUE) # comment -NULL else NULL - -if(TRUE # comment -)NULL else NULL - -if( # comment -TRUE)NULL else NULL +if (TRUE) { # comment + NULL +} else { + NULL +} + +if (TRUE # comment +) { + NULL +} else { + NULL +} + +if ( # comment + TRUE) { + NULL +} else { + NULL +} if # comment -(TRUE)NULL else NULL +(TRUE) { + NULL +} else { + NULL +} diff --git a/tests/testthat/insertion_comment_interaction/if_else_non_strict-out.R b/tests/testthat/insertion_comment_interaction/if_else_non_strict-out.R index e728573e5..27af5497e 100644 --- a/tests/testthat/insertion_comment_interaction/if_else_non_strict-out.R +++ b/tests/testthat/insertion_comment_interaction/if_else_non_strict-out.R @@ -3,20 +3,38 @@ if (TRUE) NULL else NULL if (TRUE) NULL else NULL # comment -if (TRUE) NULL else # comment +if (TRUE) { NULL +} else { # comment + NULL +} # if(TRUE)NULL # comment # else NULL -if (TRUE) # comment - NULL else NULL +if (TRUE) { # comment + NULL +} else { + NULL +} if (TRUE # comment -) NULL else NULL +) { + NULL +} else { + NULL +} if ( # comment - TRUE) NULL else NULL + TRUE) { + NULL +} else { + NULL +} if # comment -(TRUE) NULL else NULL +(TRUE) { + NULL +} else { + NULL +} diff --git a/tests/testthat/insertion_comment_interaction/if_else_strict-in.R b/tests/testthat/insertion_comment_interaction/if_else_strict-in.R index 1b310f6be..27af5497e 100644 --- a/tests/testthat/insertion_comment_interaction/if_else_strict-in.R +++ b/tests/testthat/insertion_comment_interaction/if_else_strict-in.R @@ -1,22 +1,40 @@ -if(TRUE)NULL else NULL +if (TRUE) NULL else NULL -if(TRUE)NULL else NULL # comment +if (TRUE) NULL else NULL # comment -if(TRUE)NULL else # comment - NULL +if (TRUE) { + NULL +} else { # comment + NULL +} # if(TRUE)NULL # comment # else NULL -if(TRUE) # comment -NULL else NULL - -if(TRUE # comment -)NULL else NULL - -if( # comment -TRUE)NULL else NULL +if (TRUE) { # comment + NULL +} else { + NULL +} + +if (TRUE # comment +) { + NULL +} else { + NULL +} + +if ( # comment + TRUE) { + NULL +} else { + NULL +} if # comment -(TRUE)NULL else NULL +(TRUE) { + NULL +} else { + NULL +} diff --git a/tests/testthat/insertion_comment_interaction/just_if_non_strict-in.R b/tests/testthat/insertion_comment_interaction/just_if_non_strict-in.R index 5fbaf5d47..ce265b218 100644 --- a/tests/testthat/insertion_comment_interaction/just_if_non_strict-in.R +++ b/tests/testthat/insertion_comment_interaction/just_if_non_strict-in.R @@ -1,16 +1,23 @@ -if(TRUE)NULL +if (TRUE) NULL -if(TRUE)NULL # comment +if (TRUE) NULL # comment -if(TRUE) # comment -NULL +if (TRUE) { # comment + NULL +} -if(TRUE # comment -)NULL +if (TRUE # comment +) { + NULL +} -if( # comment -TRUE)NULL +if ( # comment + TRUE) { + NULL +} if # comment -(TRUE)NULL +(TRUE) { + NULL +} diff --git a/tests/testthat/insertion_comment_interaction/just_if_non_strict-out.R b/tests/testthat/insertion_comment_interaction/just_if_non_strict-out.R index 4056cbac8..ce265b218 100644 --- a/tests/testthat/insertion_comment_interaction/just_if_non_strict-out.R +++ b/tests/testthat/insertion_comment_interaction/just_if_non_strict-out.R @@ -3,14 +3,21 @@ if (TRUE) NULL if (TRUE) NULL # comment -if (TRUE) # comment +if (TRUE) { # comment NULL +} if (TRUE # comment -) NULL +) { + NULL +} if ( # comment - TRUE) NULL + TRUE) { + NULL +} if # comment -(TRUE) NULL +(TRUE) { + NULL +} diff --git a/tests/testthat/insertion_comment_interaction/just_if_strict-in.R b/tests/testthat/insertion_comment_interaction/just_if_strict-in.R index 5fbaf5d47..ce265b218 100644 --- a/tests/testthat/insertion_comment_interaction/just_if_strict-in.R +++ b/tests/testthat/insertion_comment_interaction/just_if_strict-in.R @@ -1,16 +1,23 @@ -if(TRUE)NULL +if (TRUE) NULL -if(TRUE)NULL # comment +if (TRUE) NULL # comment -if(TRUE) # comment -NULL +if (TRUE) { # comment + NULL +} -if(TRUE # comment -)NULL +if (TRUE # comment +) { + NULL +} -if( # comment -TRUE)NULL +if ( # comment + TRUE) { + NULL +} if # comment -(TRUE)NULL +(TRUE) { + NULL +} diff --git a/tests/testthat/line_breaks_and_other/assignment-in.R b/tests/testthat/line_breaks_and_other/assignment-in.R index 00180be41..681ded9e5 100644 --- a/tests/testthat/line_breaks_and_other/assignment-in.R +++ b/tests/testthat/line_breaks_and_other/assignment-in.R @@ -12,14 +12,13 @@ x <- 3 -x = # +x <- # 2 -x = 3 - -x = +x <- 3 +x <- # comment 3 @@ -36,5 +35,4 @@ ImportantDataFrame$ImportantColumn1 <- ImportantDataFrame$ImportantColumn1 <- - ImportantDataFrame$ImportantColumn2 <- ComplicatedFunction(ImportantDataFrame$InputColumn) diff --git a/tests/testthat/line_breaks_and_other/base-pipe-line-breaks-in.R b/tests/testthat/line_breaks_and_other/base-pipe-line-breaks-in.R index 880f22cf0..ff199a4ba 100644 --- a/tests/testthat/line_breaks_and_other/base-pipe-line-breaks-in.R +++ b/tests/testthat/line_breaks_and_other/base-pipe-line-breaks-in.R @@ -4,24 +4,24 @@ c(a |> b()) c(a + b |> c()) -c(a |> b() -) +c(a |> b()) -c(a |> b() # 33 +c( + a |> b() # 33 ) c( a + b |> c() - ) +) c( a + b |> - c()) - -c(a + b |> c() ) +c(a + b |> + c()) + c( a + b |> # 654 c() @@ -38,49 +38,56 @@ c( ) c(a + - b |> c() -) + b |> c()) -a |> b( -) +a |> b() -a |> b( -) |> q() +a |> + b() |> + q() a |> b() -a |> b() |> c() +a |> + b() |> + c() # short pipes < 2 can stay on one line a |> b() -fun(x, - a |> b()) +fun( + x, + a |> b() +) fun(x, - gg = a |> b(), - tt |> q()) + gg = a |> b(), + tt |> q() +) fun(x, gg = a |> b(), tt |> q()) -z = a |> b() +z <- a |> b() -fun( s = g(x), - gg = a(n == 2) |> b(), - tt |> q(r = 3)) +fun( + s = g(x), + gg = a(n == 2) |> b(), + tt |> q(r = 3) +) # FIXME closing brace could go on ntext line. Alternative: remove lin breaks completely. blew(x |> - - c(), y = 2) + c(), y = 2) # FIXME closing brace could go on ntext line. Alternative: move c() up. blew(y = 2, x |> - c()) + c()) -{a |> c() +1} +{ + a |> c() + 1 +} b |> f() |> # never move comment to next line as it can be styler: off or nolint diff --git a/tests/testthat/line_breaks_and_other/braces-fun-calls1-in.R b/tests/testthat/line_breaks_and_other/braces-fun-calls1-in.R index 362094575..df9b2137d 100644 --- a/tests/testthat/line_breaks_and_other/braces-fun-calls1-in.R +++ b/tests/testthat/line_breaks_and_other/braces-fun-calls1-in.R @@ -3,18 +3,19 @@ test_that(x, { hh }) -test_that(x, - { - hh - } -) +test_that(x, { + hh +}) # there are multiple brace expressions that spread over multiple lines # (classical tryCatch) -tryCatch({ - exp(x) -}, error = function(x) x) +tryCatch( + { + exp(x) + }, + error = function(x) x +) tryCatch( { @@ -23,13 +24,16 @@ tryCatch( error = function(x) x ) -call({ - blibla -}, { - blublo -}) +call( + { + blibla + }, + { + blublo + } +) # curly-curly is respected -fio({{x}}) +fio({{ x }}) test_that("x", {{ k }}) diff --git a/tests/testthat/line_breaks_and_other/braces-fun-calls2-in.R b/tests/testthat/line_breaks_and_other/braces-fun-calls2-in.R index 64741bb93..527a0d7c2 100644 --- a/tests/testthat/line_breaks_and_other/braces-fun-calls2-in.R +++ b/tests/testthat/line_breaks_and_other/braces-fun-calls2-in.R @@ -2,15 +2,20 @@ test( "x", { - }, a + b, { + }, + a + b, + { s(x = sd) } ) test( - "x", { + "x", + { - }, a + b, { + }, + a + b, + { s(x = sd) } ) @@ -20,7 +25,8 @@ test( { }, - a + b, { + a + b, + { s(x = sd) } ) @@ -42,7 +48,8 @@ test( { }, # h - a + b, { + a + b, + { s(x = sd) } ) @@ -64,7 +71,7 @@ test( { }, - a + b, # k + a + b, # k { s(x = sd) } @@ -74,5 +81,6 @@ tetst( "x", { x - }, 1 + +1 + }, + 1 + +1 ) diff --git a/tests/testthat/line_breaks_and_other/comma-in.R b/tests/testthat/line_breaks_and_other/comma-in.R index dba179386..826ef5d41 100644 --- a/tests/testthat/line_breaks_and_other/comma-in.R +++ b/tests/testthat/line_breaks_and_other/comma-in.R @@ -1,20 +1,23 @@ -call(a, - b - , c) - -call(a, b - , - c) +call( + a, + b, + c +) -call(a,) -call(a, +call( + a, b, + c ) -call(a - ,) +call(a, ) +call(a, ) + +call(a, ) mpg %>% - summarise(avg_cty = mean(cty) -, avg_hwy = mean(hwy) -, n = n() -, n_class = n_distinct(class)) + summarise( + avg_cty = mean(cty), + avg_hwy = mean(hwy), + n = n(), + n_class = n_distinct(class) + ) diff --git a/tests/testthat/line_breaks_and_other/curly-in.R b/tests/testthat/line_breaks_and_other/curly-in.R index fada7e486..6f1f53272 100644 --- a/tests/testthat/line_breaks_and_other/curly-in.R +++ b/tests/testthat/line_breaks_and_other/curly-in.R @@ -1,24 +1,24 @@ # { never on its own line -if (y == 0) -{ +if (y == 0) { 1 } else { 2 } -test_that("I am here", - { - a_test(x) - }) +test_that("I am here", { + a_test(x) +}) # A { should always be followed by a new line -if (x > 3) { "x" +if (x > 3) { + "x" } # A } should always go on its own line, unless it's followed by else or ). if (x > 3) { - "x"} + "x" +} # ELSE can't be tested fully since "[...] } \n else [...]" is invalid R code. if (1 > 3) { @@ -29,5 +29,4 @@ if (1 > 3) { test_that("I am here", { a_test(x) -} -) +}) diff --git a/tests/testthat/line_breaks_and_other/ggplot2-in.R b/tests/testthat/line_breaks_and_other/ggplot2-in.R index c767dca7a..9a46ec2b4 100644 --- a/tests/testthat/line_breaks_and_other/ggplot2-in.R +++ b/tests/testthat/line_breaks_and_other/ggplot2-in.R @@ -4,34 +4,43 @@ ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + # add when unmasked -ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + geom_point() +ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + + geom_point() # add when masked -ggplot2::ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + geom_point() +ggplot2::ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + + geom_point() # add when masked -ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + ggplot2::geom_point() +ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + + ggplot2::geom_point() # add when comment ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + # comment - ggplot2::geom_point() + g() + ggplot2::geom_point() + + g() # add when comment ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + - ggplot2::geom_point() + g() # comment + ggplot2::geom_point() + + g() # comment # add when comment -ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + ggplot2::geom_point() + g() # comment +ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + + ggplot2::geom_point() + + g() # comment # add when comment ggplot(data = mtcars, mapping = aes(x = mpg, y = vs)) + - ggplot2::geom_point() + g() + geom_oint() # comment + ggplot2::geom_point() + + g() + + geom_oint() # comment # when subsetted involved -x[1]+ c() +x[1] + c() g() + x[1] diff --git a/tests/testthat/line_breaks_and_other/if_with_line_break_indention-in.R b/tests/testthat/line_breaks_and_other/if_with_line_break_indention-in.R index df35cae4c..1bd955003 100644 --- a/tests/testthat/line_breaks_and_other/if_with_line_break_indention-in.R +++ b/tests/testthat/line_breaks_and_other/if_with_line_break_indention-in.R @@ -1,8 +1,11 @@ # adding line-break -if (x) {1+1++1} else{3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", -{ +test_that("x", { my_test(call) }) diff --git a/tests/testthat/line_breaks_and_other/non_strict-in.R b/tests/testthat/line_breaks_and_other/non_strict-in.R index 2a47f8a3d..a9c245068 100644 --- a/tests/testthat/line_breaks_and_other/non_strict-in.R +++ b/tests/testthat/line_breaks_and_other/non_strict-in.R @@ -1,11 +1,7 @@ -a <- {3} - a <- { + 3 +} - - 3+1 - - - - +a <- { + 3 + 1 } diff --git a/tests/testthat/line_breaks_and_other/non_strict-out.R b/tests/testthat/line_breaks_and_other/non_strict-out.R index 71c76061b..a9c245068 100644 --- a/tests/testthat/line_breaks_and_other/non_strict-out.R +++ b/tests/testthat/line_breaks_and_other/non_strict-out.R @@ -3,11 +3,5 @@ a <- { } a <- { - - 3 + 1 - - - - } diff --git a/tests/testthat/line_breaks_and_other/pipe-line-breaks-in.R b/tests/testthat/line_breaks_and_other/pipe-line-breaks-in.R index a60021669..093655a80 100644 --- a/tests/testthat/line_breaks_and_other/pipe-line-breaks-in.R +++ b/tests/testthat/line_breaks_and_other/pipe-line-breaks-in.R @@ -1,88 +1,97 @@ -c(a %>% b) +c(a %>% b()) c(a %>% b()) -c(a + b %>% c) +c(a + b %>% c()) c( - a %>% b) - -c(a %>% b() + a %>% b() ) -c(a %>% b() # 33 +c(a %>% b()) + +c( + a %>% b() # 33 ) c( - a + b %>% c - ) + a + b %>% c() +) c( a + b %>% - c) + c() +) c(a + b %>% - c) + c()) c( a + b %>% # 654 - c + c() ) c( # rr a + b %>% - c + c() ) c( a + - b %>% c + b %>% c() ) c(a + - b %>% c -) + b %>% c()) -a %>% b( -) +a %>% b() -a %>% b( -) %>% q +a %>% + b() %>% + q() a %>% b() -a %>% b() %>% c +a %>% + b() %>% + c() # short pipes < 2 can stay on one line a %>% b() -fun(x, - a %>% b) +fun( + x, + a %>% b() +) fun(x, - gg = a %>% b, - tt %>% q) + gg = a %>% b(), + tt %>% q() +) -fun(x, gg = a %>% b, tt %>% q) +fun(x, gg = a %>% b(), tt %>% q()) -z = a %>% b() +z <- a %>% b() -fun( s = g(x), - gg = a(n == 2) %>% b, - tt %>% q(r = 3)) +fun( + s = g(x), + gg = a(n == 2) %>% b(), + tt %>% q(r = 3) +) # FIXME closing brace could go on ntext line. Alternative: remove lin breaks completely. blew(x %>% - - c(), y = 2) + c(), y = 2) # FIXME closing brace could go on ntext line. Alternative: move c() up. blew(y = 2, x %>% - c()) + c()) -{a %>% c +1} +{ + a %>% c() + 1 +} b %>% @@ -93,14 +102,16 @@ b %>% # line break before { inserted inside and outside function calls c( -data %>% - filter(bar) %>% { - cor(.$col1, .$col2, use = "complete.obs") - } + data %>% + filter(bar) %>% + { + cor(.$col1, .$col2, use = "complete.obs") + } ) data %>% - filter(bar) %>% { + filter(bar) %>% + { cor(.$col1, .$col2, use = "complete.obs") } @@ -123,7 +134,6 @@ data %>% c( data %>% filter(bar) %>% - { cor(.$col1, .$col2, use = "complete.obs") } @@ -131,7 +141,6 @@ c( data %>% filter(bar) %>% - { cor(.$col1, .$col2, use = "complete.obs") } diff --git a/tests/testthat/line_breaks_fun_call/blank-non-strict-in.R b/tests/testthat/line_breaks_fun_call/blank-non-strict-in.R index 21225f5f8..c986f7171 100644 --- a/tests/testthat/line_breaks_fun_call/blank-non-strict-in.R +++ b/tests/testthat/line_breaks_fun_call/blank-non-strict-in.R @@ -1,6 +1,4 @@ call( - - 1 ) @@ -13,6 +11,5 @@ call( call( x = 2, 1, - "w" ) diff --git a/tests/testthat/line_breaks_fun_call/blank-non-strict-out.R b/tests/testthat/line_breaks_fun_call/blank-non-strict-out.R index 21225f5f8..c986f7171 100644 --- a/tests/testthat/line_breaks_fun_call/blank-non-strict-out.R +++ b/tests/testthat/line_breaks_fun_call/blank-non-strict-out.R @@ -1,6 +1,4 @@ call( - - 1 ) @@ -13,6 +11,5 @@ call( call( x = 2, 1, - "w" ) diff --git a/tests/testthat/line_breaks_fun_call/blank-strict-in.R b/tests/testthat/line_breaks_fun_call/blank-strict-in.R index 5f67ed329..cb9acea09 100644 --- a/tests/testthat/line_breaks_fun_call/blank-strict-in.R +++ b/tests/testthat/line_breaks_fun_call/blank-strict-in.R @@ -1,6 +1,4 @@ call( - - 1 ) @@ -13,7 +11,6 @@ call( call( x = 2, 1, - "w" ) @@ -27,6 +24,5 @@ call( 1, 2, - 3 ) diff --git a/tests/testthat/line_breaks_fun_call/line_breaks_and_comments-in.R b/tests/testthat/line_breaks_fun_call/line_breaks_and_comments-in.R index 7144eb4fc..d2498155b 100644 --- a/tests/testthat/line_breaks_fun_call/line_breaks_and_comments-in.R +++ b/tests/testthat/line_breaks_fun_call/line_breaks_and_comments-in.R @@ -7,16 +7,17 @@ call( am ) -call(am # comment +call( + am # comment ) -call(am, # comment +call( + am, # comment pm ) -call(b -) +call(b) call( a @@ -29,7 +30,9 @@ call( call( # ) -call(a # b +call( + a # b +) +call( # b + a ) -call(# b - a) diff --git a/tests/testthat/line_breaks_fun_call/named_arguments-in.R b/tests/testthat/line_breaks_fun_call/named_arguments-in.R index f9c70a872..485e4d609 100644 --- a/tests/testthat/line_breaks_fun_call/named_arguments-in.R +++ b/tests/testthat/line_breaks_fun_call/named_arguments-in.R @@ -1,18 +1,24 @@ call(3, - b = 2, c + b = 2, c ) -gs(3, b = 2, - c) +gs(3, + b = 2, + c +) call(3, b = 2, c) map(data, fun, - x = 3, z = 33) + x = 3, z = 33 +) -map2(dat1, data2, fun, x, y, - z) +map2( + dat1, data2, fun, x, y, + z +) -map2(dat1, data2, fun, x = 1, y = 2, +map2(dat1, data2, fun, + x = 1, y = 2, z ) diff --git a/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R b/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R index db6ecd18f..e6cfeee64 100644 --- a/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R +++ b/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R @@ -3,8 +3,7 @@ call( 3 ) -switch( - x, +switch(x, a = 2, y = 3 ) @@ -18,30 +17,35 @@ switch( # -switch( - x, +switch(x, a = 2, # - - y = 3 ) -switch( - x,a = 2, - y = 3 +switch(x, + a = 2, + y = 3 ) -switch(x,a = 2, +switch(x, + a = 2, y = 3 ) -switch(x,a = 2, y = 3) +switch(x, + a = 2, + y = 3 +) -switch(x,a = 2, y = 3 +switch(x, + a = 2, + y = 3 ) # -switch(x,a = 2, y = 3 # +switch(x, + a = 2, + y = 3 # ) if_else(a, @@ -55,21 +59,20 @@ ifelse(x, # namespacing base::switch(f, - x = 2, - y = 3 + x = 2, + y = 3 ) -base::switch( - f, - x = 2, - y = 3 +base::switch(f, + x = 2, + y = 3 ) dplyr::ifelse(x, - 1, 32 + 1, 32 ) dplyr::ifelse( x, - 1, 32 + 1, 32 ) diff --git a/tests/testthat/line_breaks_fun_call/token_dependent_comments-in.R b/tests/testthat/line_breaks_fun_call/token_dependent_comments-in.R index 5891cd5ff..68cb70a94 100644 --- a/tests/testthat/line_breaks_fun_call/token_dependent_comments-in.R +++ b/tests/testthat/line_breaks_fun_call/token_dependent_comments-in.R @@ -1,7 +1,8 @@ -call(call( # comment -3 , 4 - )) +call(call( # comment + 3, 4 +)) -call( call(1, # comment - 3 +call(call( + 1, # comment + 3 )) diff --git a/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-in.R b/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-in.R index 779eba3e3..093fd65cf 100644 --- a/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-in.R +++ b/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-in.R @@ -2,30 +2,37 @@ call(call( 2 )) -call(call(1, - 2)) +call(call( + 1, + 2 +)) # multi-line: no indention based on first vall call(a(b(c({ })))) +call( + call( + 2 + ), + 5 +) + + call(call( - 2 ) , - 5 ) - - -call(call(1, - 2, c( - 3 - ))) - -call(1, - call2(3, 4, call(3, - 4, call(5, 6, call( - 2 - ) - ) - ) - ) + 1, + 2, c( + 3 + ) +)) + +call( + 1, + call2(3, 4, call( + 3, + 4, call(5, 6, call( + 2 + )) + )) ) # comment lala diff --git a/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-out.R b/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-out.R index 8ef14cf81..093fd65cf 100644 --- a/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-out.R +++ b/tests/testthat/line_breaks_fun_call/token_dependent_complex_non_strict-out.R @@ -2,30 +2,37 @@ call(call( 2 )) -call(call(1, - 2)) +call(call( + 1, + 2 +)) # multi-line: no indention based on first vall call(a(b(c({ })))) -call(call( - 2), -5) +call( + call( + 2 + ), + 5 +) -call(call(1, +call(call( + 1, 2, c( 3 -))) + ) +)) -call(1, - call2(3, 4, call(3, +call( + 1, + call2(3, 4, call( + 3, 4, call(5, 6, call( 2 - ) - ) - ) - ) + )) + )) ) # comment lala diff --git a/tests/testthat/line_breaks_fun_call/token_dependent_complex_strict-in.R b/tests/testthat/line_breaks_fun_call/token_dependent_complex_strict-in.R index c8eabf856..093fd65cf 100644 --- a/tests/testthat/line_breaks_fun_call/token_dependent_complex_strict-in.R +++ b/tests/testthat/line_breaks_fun_call/token_dependent_complex_strict-in.R @@ -1,39 +1,46 @@ call(call( -2 - )) + 2 +)) -call( call(1, - 2) ) +call(call( + 1, + 2 +)) # multi-line: no indention based on first vall -call(a(b( c({ - })))) - - call(call( - 2 ) , -5 ) +call(a(b(c({ +})))) + +call( + call( + 2 + ), + 5 +) - call(call(1, - 2, c( - 3 - ))) +call(call( + 1, + 2, c( + 3 + ) +)) -call(1, - call2(3, 4, call(3, -4, call(5, 6, call( -2 -) -) -) -) +call( + 1, + call2(3, 4, call( + 3, + 4, call(5, 6, call( + 2 + )) + )) ) # comment lala call(call( -2 + 2 )) - call(1, call( +call(1, call( 23 )) diff --git a/tests/testthat/line_breaks_fun_call/token_dependent_mixed-in.R b/tests/testthat/line_breaks_fun_call/token_dependent_mixed-in.R index 64ea75775..d588f1ff0 100644 --- a/tests/testthat/line_breaks_fun_call/token_dependent_mixed-in.R +++ b/tests/testthat/line_breaks_fun_call/token_dependent_mixed-in.R @@ -1,15 +1,19 @@ -call(call(call3(), call, - 4433, - 55)) +call(call( + call3(), call, + 4433, + 55 +)) -call(call(call3(), call, - 4433, - 55 +call(call( + call3(), call, + 4433, + 55 +)) +call(call( + call3(), call, + 4433, + 55 )) -call(call(call3(), call, - 4433, - 55) -) @@ -19,46 +23,56 @@ call(call( )) -call(3 , - 3 +call( + 3, + 3 ) -call(call(call3(), call, - 44, - 55 +call(call( + call3(), call, + 44, + 55 )) # -call(call,call(), - 3, - 4 +call( + call, call(), + 3, + 4 ) call(call( - 3 , 4 + 3, 4 )) -call(call(1, - 3 +call(call( + 1, + 3 )) # if a multiline expression follows -> don't indent - call( -2 - ) -cjaldfjadf(1, - 3) +call( + 2 +) +cjaldfjadf( + 1, + 3 +) -jclakjdscs( call(call(2 , - 4))) - fjadlksfj(casl(), - 1) +jclakjdscs(call(call( + 2, + 4 +))) +fjadlksfj( + casl(), + 1 +) test_that("hi", { -"there" - }) + "there" +}) diff --git a/tests/testthat/math_token_spacing/non_strict_math_spacing_all-in.R b/tests/testthat/math_token_spacing/non_strict_math_spacing_all-in.R index 580a7edc4..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/non_strict_math_spacing_all-in.R +++ b/tests/testthat/math_token_spacing/non_strict_math_spacing_all-in.R @@ -1 +1 @@ -1++1 - 3 / 23 * 3 ^4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/math_token_spacing/non_strict_math_spacing_all-out.R b/tests/testthat/math_token_spacing/non_strict_math_spacing_all-out.R index 1c1a997f0..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/non_strict_math_spacing_all-out.R +++ b/tests/testthat/math_token_spacing/non_strict_math_spacing_all-out.R @@ -1 +1 @@ -1 + +1 - 3 / 23 * 3^4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/math_token_spacing/strict_math_spacing_all-in.R b/tests/testthat/math_token_spacing/strict_math_spacing_all-in.R index c05b34f65..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/strict_math_spacing_all-in.R +++ b/tests/testthat/math_token_spacing/strict_math_spacing_all-in.R @@ -1 +1 @@ -1 ++ 1 - 3 / 23* 3^ 4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-in.R b/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-in.R index 70d4cd963..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-in.R +++ b/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-in.R @@ -1 +1 @@ -1++1-3/23*3^4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-out.R b/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-out.R index 1f561bdb8..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-out.R +++ b/tests/testthat/math_token_spacing/strict_math_spacing_zero_all_but_power-out.R @@ -1 +1 @@ -1++1-3/23*3 ^ 4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-in.R b/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-in.R index 0409b44dd..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-in.R +++ b/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-in.R @@ -1 +1 @@ -1+ +1- 3 /23* 3^ 4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-out.R b/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-out.R index ac744cc2a..d259e95fc 100644 --- a/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-out.R +++ b/tests/testthat/math_token_spacing/strict_math_spacing_zero_plus-out.R @@ -1 +1 @@ -1++1 - 3 / 23 * 3 ^ 4 +1 + +1 - 3 / 23 * 3^4 diff --git a/tests/testthat/multiple_expressions/three_complex_expr-in.R b/tests/testthat/multiple_expressions/three_complex_expr-in.R index 13684dd10..43a7c38ea 100644 --- a/tests/testthat/multiple_expressions/three_complex_expr-in.R +++ b/tests/testthat/multiple_expressions/three_complex_expr-in.R @@ -1,5 +1,5 @@ x -1+1 +1 + 1 y + ( -2* z + 2 * z ) diff --git a/tests/testthat/parse_comments/eol_eof_spaces-in.R b/tests/testthat/parse_comments/eol_eof_spaces-in.R index 1fc7a92c1..b620f0aab 100644 --- a/tests/testthat/parse_comments/eol_eof_spaces-in.R +++ b/tests/testthat/parse_comments/eol_eof_spaces-in.R @@ -1,5 +1,3 @@ -# comment -#' spaces -a - - +# comment +#' spaces +a diff --git a/tests/testthat/parse_comments/mixed-in.R b/tests/testthat/parse_comments/mixed-in.R index f954a0563..e89194c12 100644 --- a/tests/testthat/parse_comments/mixed-in.R +++ b/tests/testthat/parse_comments/mixed-in.R @@ -1,7 +1,7 @@ # A file with text a <- function(x, y, z) { -if (1>10) { -# this is a comment -} -#' another comment + if (1 > 10) { + # this is a comment + } + #' another comment } diff --git a/tests/testthat/parse_comments/mixed-out.R b/tests/testthat/parse_comments/mixed-out.R index f954a0563..e89194c12 100644 --- a/tests/testthat/parse_comments/mixed-out.R +++ b/tests/testthat/parse_comments/mixed-out.R @@ -1,7 +1,7 @@ # A file with text a <- function(x, y, z) { -if (1>10) { -# this is a comment -} -#' another comment + if (1 > 10) { + # this is a comment + } + #' another comment } diff --git a/tests/testthat/parse_comments/rplumber-in.R b/tests/testthat/parse_comments/rplumber-in.R index 186413cb6..71a98b86b 100644 --- a/tests/testthat/parse_comments/rplumber-in.R +++ b/tests/testthat/parse_comments/rplumber-in.R @@ -1,7 +1,7 @@ # myfile.R #* @get /mean -normalMean <- function(samples=10) { +normalMean <- function(samples = 10) { data <- rnorm(samples) mean(data) } diff --git a/tests/testthat/parse_comments/shebang_1-in.R b/tests/testthat/parse_comments/shebang_1-in.R index 210862b44..a145d2c47 100644 --- a/tests/testthat/parse_comments/shebang_1-in.R +++ b/tests/testthat/parse_comments/shebang_1-in.R @@ -1,10 +1,10 @@ -#A comment -#!/usr/bin/env Rscript -#!/usr/bin/env Rscript +# A comment +# !/usr/bin/env Rscript +# !/usr/bin/env Rscript a <- 3 -#!/usr/bin /env Rscript -m --set "W" +# !/usr/bin /env Rscript -m --set "W" dd <- 33 -#!/usr/bin\ /env Rscript -m --set "W" +# !/usr/bin\ /env Rscript -m --set "W" c() -#!NEED TO REMOVE THIS +# !NEED TO REMOVE THIS diff --git a/tests/testthat/parse_comments/shebang_2-in.R b/tests/testthat/parse_comments/shebang_2-in.R index c47bec7a3..8e8f5ac04 100644 --- a/tests/testthat/parse_comments/shebang_2-in.R +++ b/tests/testthat/parse_comments/shebang_2-in.R @@ -1,9 +1,9 @@ #!/usr/bin/env Rscript -#!/usr/bin/env Rscript +# !/usr/bin/env Rscript a <- 3 -#!/usr/bin /env Rscript -m --set "W" +# !/usr/bin /env Rscript -m --set "W" dd <- 33 -#!/usr/bin\ /env Rscript -m --set "W" +# !/usr/bin\ /env Rscript -m --set "W" c() -#!NEED TO REMOVE THIS +# !NEED TO REMOVE THIS diff --git a/tests/testthat/parse_comments/spacing_before-in.R b/tests/testthat/parse_comments/spacing_before-in.R index c18172225..fee7cfd36 100644 --- a/tests/testthat/parse_comments/spacing_before-in.R +++ b/tests/testthat/parse_comments/spacing_before-in.R @@ -1,5 +1,5 @@ -a <-function(x){# test -# indnted comment +a <- function(x) { # test + # indnted comment } - # another comment +# another comment diff --git a/tests/testthat/parse_comments/spinning_code_chunk_headers-in.R b/tests/testthat/parse_comments/spinning_code_chunk_headers-in.R index 198d8b6ab..88ab28999 100644 --- a/tests/testthat/parse_comments/spinning_code_chunk_headers-in.R +++ b/tests/testthat/parse_comments/spinning_code_chunk_headers-in.R @@ -1,4 +1,4 @@ -#A comment +# A comment a <- function() { } @@ -8,4 +8,4 @@ a <- function() { #- chunk-label, opt1=value1 call(2, 3) -#21 +# 21 diff --git a/tests/testthat/parse_comments/with_indention-in.R b/tests/testthat/parse_comments/with_indention-in.R index 4a38ffcbd..5854b9515 100644 --- a/tests/testthat/parse_comments/with_indention-in.R +++ b/tests/testthat/parse_comments/with_indention-in.R @@ -1,18 +1,18 @@ # a comment call( -1, -call2( -2, 3, -call3(# zero -# one - # two2 + 1, + call2( + 2, 3, + call3( # zero + # one + # two2 1, 2 # two , 22 # comment - ), + ), 5 ), #' A roxygen comment - 144 - # anotehr indented comment + 144 + # anotehr indented comment ) # new comment @@ -23,7 +23,7 @@ call3(# zero a() # I think it gets boring # new_line here -b(x, y, 7) # hidden? +b(x, y, 7) # hidden? # comments belong to previous token. diff --git a/tests/testthat/parse_comments/within_spacing_with_force-in.R b/tests/testthat/parse_comments/within_spacing_with_force-in.R index c4b481961..bae46d588 100644 --- a/tests/testthat/parse_comments/within_spacing_with_force-in.R +++ b/tests/testthat/parse_comments/within_spacing_with_force-in.R @@ -1,6 +1,6 @@ ####### A comment -#'roxygen +#' roxygen -#rox +# rox # a #-ish within a comment diff --git a/tests/testthat/parse_comments/within_spacing_without_force-in.R b/tests/testthat/parse_comments/within_spacing_without_force-in.R index c4b481961..bae46d588 100644 --- a/tests/testthat/parse_comments/within_spacing_without_force-in.R +++ b/tests/testthat/parse_comments/within_spacing_without_force-in.R @@ -1,6 +1,6 @@ ####### A comment -#'roxygen +#' roxygen -#rox +# rox # a #-ish within a comment diff --git a/tests/testthat/parsing/long_strings-in.R b/tests/testthat/parsing/long_strings-in.R index 4268e6dab..9af67f0ee 100644 --- a/tests/testthat/parsing/long_strings-in.R +++ b/tests/testthat/parsing/long_strings-in.R @@ -1,7 +1,7 @@ b <- - 3 + 3 g <- -"v x ijyuldlf ixi tt ucw nk xejkf omch ujm ymgsgkwickxn tg zknjxmk aqtgqrn bhv + "v x ijyuldlf ixi tt ucw nk xejkf omch ujm ymgsgkwickxn tg zknjxmk aqtgqrn bhv se g ec avo xs nyz fhadktjlwuocti au y gxv y xbr x kxn om dkaderkl xqok pp ud lcw pnft ggzz lu v sgs ysv uyyxp gmcvt o rumej rfed j qy ozo oq wz na oii m rg imfktlkwisc wvc y ab ms pjugxh ieco xjdfiysqsnoizgzz @@ -30,7 +30,7 @@ g <- "'test'" 99 + 1 -'test' +"test" 'test"ji"' # comment 1 diff --git a/tests/testthat/public-api/dry/unstyled.R b/tests/testthat/public-api/dry/unstyled.R index c040fa67d..8d2f0971e 100644 --- a/tests/testthat/public-api/dry/unstyled.R +++ b/tests/testthat/public-api/dry/unstyled.R @@ -1 +1 @@ -1+1 +1 + 1 diff --git a/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-spaces.R b/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-spaces.R index c040fa67d..8d2f0971e 100644 --- a/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-spaces.R +++ b/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-spaces.R @@ -1 +1 @@ -1+1 +1 + 1 diff --git a/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-tokens.R b/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-tokens.R index 0d5a9c19e..f96c552d0 100644 --- a/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-tokens.R +++ b/tests/testthat/public-api/xyzdir-dirty/dirty-sample-with-scope-tokens.R @@ -1,2 +1,3 @@ -if (TRUE) +if (TRUE) { 3 +} diff --git a/tests/testthat/public-api/xyzfile/random-script.R b/tests/testthat/public-api/xyzfile/random-script.R index 62ba053b8..426b22111 100644 --- a/tests/testthat/public-api/xyzfile/random-script.R +++ b/tests/testthat/public-api/xyzfile/random-script.R @@ -2,6 +2,6 @@ this(is_a_call(x)) if (x) { r() - a <- 3 + a <- 3 bcds <- 5 } diff --git a/tests/testthat/public-api/xyzfile/subfolder/random-script.R b/tests/testthat/public-api/xyzfile/subfolder/random-script.R index 62ba053b8..426b22111 100644 --- a/tests/testthat/public-api/xyzfile/subfolder/random-script.R +++ b/tests/testthat/public-api/xyzfile/subfolder/random-script.R @@ -2,6 +2,6 @@ this(is_a_call(x)) if (x) { r() - a <- 3 + a <- 3 bcds <- 5 } diff --git a/tests/testthat/reference-objects/missing-blank-at-EOF.R b/tests/testthat/reference-objects/missing-blank-at-EOF.R index c1b0730e0..587be6b4c 100644 --- a/tests/testthat/reference-objects/missing-blank-at-EOF.R +++ b/tests/testthat/reference-objects/missing-blank-at-EOF.R @@ -1 +1 @@ -x \ No newline at end of file +x diff --git a/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-in.R b/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-in.R index 145023e9e..b618f464b 100644 --- a/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-in.R +++ b/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-in.R @@ -1,5 +1,7 @@ -x = 5 +x <- 5 -if(x >= 5) - y = TRUE else - y = FALSE +if (x >= 5) { + y <- TRUE +} else { + y <- FALSE +} diff --git a/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-out.R b/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-out.R index bbd146499..b618f464b 100644 --- a/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-out.R +++ b/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_line_breaks-out.R @@ -1,5 +1,7 @@ -x = 5 +x <- 5 -if (x >= 5) - y = TRUE else - y = FALSE +if (x >= 5) { + y <- TRUE +} else { + y <- FALSE +} diff --git a/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_tokens-in.R b/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_tokens-in.R index 145023e9e..b618f464b 100644 --- a/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_tokens-in.R +++ b/tests/testthat/relocate_eq_assign/eq_assign_ifelse_scope_tokens-in.R @@ -1,5 +1,7 @@ -x = 5 +x <- 5 -if(x >= 5) - y = TRUE else - y = FALSE +if (x >= 5) { + y <- TRUE +} else { + y <- FALSE +} diff --git a/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_eq_only-in.R b/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_eq_only-in.R index 5cde17473..ecf0b9bc0 100644 --- a/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_eq_only-in.R +++ b/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_eq_only-in.R @@ -1,4 +1,9 @@ -a = b = c = d = e = f = g = 4 -a <- 3; b = c = d = ey <- 4 -a <- 3; b = c = d <- ey = 4 -ff = 3; b = c = d = 3 ; g = 4; ge = 5 +a <- b <- c <- d <- e <- f <- g <- 4 +a <- 3 +b <- c <- d <- ey <- 4 +a <- 3 +b <- c <- d <- ey <- 4 +ff <- 3 +b <- c <- d <- 3 +g <- 4 +ge <- 5 diff --git a/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_mixed-in.R b/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_mixed-in.R index 5e3c65b16..43d200b0e 100644 --- a/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_mixed-in.R +++ b/tests/testthat/relocate_eq_assign/eq_assign_multiple_tokens_mixed-in.R @@ -1 +1 @@ -a = b = c = d = e = f = g <- 4 +a <- b <- c <- d <- e <- f <- g <- 4 diff --git a/tests/testthat/scope-AsIs/scope_indention-in.R b/tests/testthat/scope-AsIs/scope_indention-in.R index e92cfb080..3377e1791 100644 --- a/tests/testthat/scope-AsIs/scope_indention-in.R +++ b/tests/testthat/scope-AsIs/scope_indention-in.R @@ -1,21 +1,26 @@ # not adding line-break -if (x) {1+1++1} else{3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # not removing line-break # FIXME If linebreaks are not touched: Do not indent token-dependent before '{' -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_indention-out.R b/tests/testthat/scope-AsIs/scope_indention-out.R index fe39c346a..3377e1791 100644 --- a/tests/testthat/scope-AsIs/scope_indention-out.R +++ b/tests/testthat/scope-AsIs/scope_indention-out.R @@ -1,21 +1,26 @@ # not adding line-break -if (x) {1+1++1} else{3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # not removing line-break # FIXME If linebreaks are not touched: Do not indent token-dependent before '{' -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_indention_tokens-in.R b/tests/testthat/scope-AsIs/scope_indention_tokens-in.R index 6e20f072d..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_indention_tokens-in.R +++ b/tests/testthat/scope-AsIs/scope_indention_tokens-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a =3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_indention_tokens-out.R b/tests/testthat/scope-AsIs/scope_indention_tokens-out.R index 47df4b7fc..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_indention_tokens-out.R +++ b/tests/testthat/scope-AsIs/scope_indention_tokens-out.R @@ -1,15 +1,18 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a <-3 +a <- 3 data_frame(a = 3) # do not resolve semicolon diff --git a/tests/testthat/scope-AsIs/scope_line_breaks-in.R b/tests/testthat/scope-AsIs/scope_line_breaks-in.R index 8fd4735e5..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_line_breaks-in.R +++ b/tests/testthat/scope-AsIs/scope_line_breaks-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_line_breaks-out.R b/tests/testthat/scope-AsIs/scope_line_breaks-out.R index c5dd80a84..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_line_breaks-out.R +++ b/tests/testthat/scope-AsIs/scope_line_breaks-out.R @@ -1,24 +1,26 @@ # adding line-break if (x) { -1 + 1 + +1 + 1 + 1 + +1 } else { -3 + 3 } # removing line-break -test_that("x", { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_none-in.R b/tests/testthat/scope-AsIs/scope_none-in.R index 2c770501f..ba9b9f874 100644 --- a/tests/testthat/scope-AsIs/scope_none-in.R +++ b/tests/testthat/scope-AsIs/scope_none-in.R @@ -1,30 +1,33 @@ -#'this function does +#' this function does #' #' @param x a parameter. #' indented comments -a<- function(x){ - test_that("I want to test",{ - out <- c(1,c( - 22 +1 +a <- function(x) { + test_that("I want to test", { + out <- c(1, c( + 22 + 1 )) if (x > 10) { for (x in 22) { # FIXME in operator only to be surrounded by one space. What about %in%? prin(x) } } - } ) - #we like comments too - c(list(x + 2), - c( c( - 26 ^ 2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple + }) + # we like comments too + c( + list(x + 2), + c(c( + 26^2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple 8, 7 - ) ) ) + )) + ) call( 1, 2, - 23+Inf - 99, call( + 23 + Inf - 99, call( 16 - )) + ) + ) } # comments everywhere diff --git a/tests/testthat/scope-AsIs/scope_none-out.R b/tests/testthat/scope-AsIs/scope_none-out.R index 2c770501f..ba9b9f874 100644 --- a/tests/testthat/scope-AsIs/scope_none-out.R +++ b/tests/testthat/scope-AsIs/scope_none-out.R @@ -1,30 +1,33 @@ -#'this function does +#' this function does #' #' @param x a parameter. #' indented comments -a<- function(x){ - test_that("I want to test",{ - out <- c(1,c( - 22 +1 +a <- function(x) { + test_that("I want to test", { + out <- c(1, c( + 22 + 1 )) if (x > 10) { for (x in 22) { # FIXME in operator only to be surrounded by one space. What about %in%? prin(x) } } - } ) - #we like comments too - c(list(x + 2), - c( c( - 26 ^ 2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple + }) + # we like comments too + c( + list(x + 2), + c(c( + 26^2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple 8, 7 - ) ) ) + )) + ) call( 1, 2, - 23+Inf - 99, call( + 23 + Inf - 99, call( 16 - )) + ) + ) } # comments everywhere diff --git a/tests/testthat/scope-AsIs/scope_spaces-in.R b/tests/testthat/scope-AsIs/scope_spaces-in.R index f8a5c9005..9640e4f9e 100644 --- a/tests/testthat/scope-AsIs/scope_spaces-in.R +++ b/tests/testthat/scope-AsIs/scope_spaces-in.R @@ -1,4 +1,4 @@ -a<-function(){ - 1+1 -d=3 - } +a <- function() { + 1 + 1 + d <- 3 +} diff --git a/tests/testthat/scope-AsIs/scope_spaces-out.R b/tests/testthat/scope-AsIs/scope_spaces-out.R index 4036923a9..9640e4f9e 100644 --- a/tests/testthat/scope-AsIs/scope_spaces-out.R +++ b/tests/testthat/scope-AsIs/scope_spaces-out.R @@ -1,4 +1,4 @@ a <- function() { - 1 + 1 -d = 3 - } + 1 + 1 + d <- 3 +} diff --git a/tests/testthat/scope-AsIs/scope_spaces_indention-in.R b/tests/testthat/scope-AsIs/scope_spaces_indention-in.R index e92cfb080..3377e1791 100644 --- a/tests/testthat/scope-AsIs/scope_spaces_indention-in.R +++ b/tests/testthat/scope-AsIs/scope_spaces_indention-in.R @@ -1,21 +1,26 @@ # not adding line-break -if (x) {1+1++1} else{3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # not removing line-break # FIXME If linebreaks are not touched: Do not indent token-dependent before '{' -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_spaces_indention-out.R b/tests/testthat/scope-AsIs/scope_spaces_indention-out.R index cb3b1ebea..3377e1791 100644 --- a/tests/testthat/scope-AsIs/scope_spaces_indention-out.R +++ b/tests/testthat/scope-AsIs/scope_spaces_indention-out.R @@ -1,21 +1,26 @@ # not adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # not removing line-break # FIXME If linebreaks are not touched: Do not indent token-dependent before '{' -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_spaces_line_breaks-in.R b/tests/testthat/scope-AsIs/scope_spaces_line_breaks-in.R index ac91f0e50..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_spaces_line_breaks-in.R +++ b/tests/testthat/scope-AsIs/scope_spaces_line_breaks-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test( call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_spaces_line_breaks-out.R b/tests/testthat/scope-AsIs/scope_spaces_line_breaks-out.R index 721ffc0af..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_spaces_line_breaks-out.R +++ b/tests/testthat/scope-AsIs/scope_spaces_line_breaks-out.R @@ -1,24 +1,26 @@ # adding line-break if (x) { -1 + 1 + +1 + 1 + 1 + +1 } else { -3 + 3 } # removing line-break test_that("x", { - my_test(call) - }) + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_spaces_tokens-in.R b/tests/testthat/scope-AsIs/scope_spaces_tokens-in.R index b39fbf37d..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_spaces_tokens-in.R +++ b/tests/testthat/scope-AsIs/scope_spaces_tokens-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 +1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_spaces_tokens-out.R b/tests/testthat/scope-AsIs/scope_spaces_tokens-out.R index 4e71757fd..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_spaces_tokens-out.R +++ b/tests/testthat/scope-AsIs/scope_spaces_tokens-out.R @@ -1,11 +1,14 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment diff --git a/tests/testthat/scope-AsIs/scope_tokens-in.R b/tests/testthat/scope-AsIs/scope_tokens-in.R index 8fd4735e5..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_tokens-in.R +++ b/tests/testthat/scope-AsIs/scope_tokens-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-AsIs/scope_tokens-out.R b/tests/testthat/scope-AsIs/scope_tokens-out.R index 4e71757fd..22b26a9cf 100644 --- a/tests/testthat/scope-AsIs/scope_tokens-out.R +++ b/tests/testthat/scope-AsIs/scope_tokens-out.R @@ -1,11 +1,14 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment diff --git a/tests/testthat/scope-character/scope_indention-in.R b/tests/testthat/scope-character/scope_indention-in.R index e92cfb080..3377e1791 100644 --- a/tests/testthat/scope-character/scope_indention-in.R +++ b/tests/testthat/scope-character/scope_indention-in.R @@ -1,21 +1,26 @@ # not adding line-break -if (x) {1+1++1} else{3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # not removing line-break # FIXME If linebreaks are not touched: Do not indent token-dependent before '{' -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-character/scope_indention-out.R b/tests/testthat/scope-character/scope_indention-out.R index cb3b1ebea..3377e1791 100644 --- a/tests/testthat/scope-character/scope_indention-out.R +++ b/tests/testthat/scope-character/scope_indention-out.R @@ -1,21 +1,26 @@ # not adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # not removing line-break # FIXME If linebreaks are not touched: Do not indent token-dependent before '{' -test_that("x", - { - my_test(call) +test_that("x", { + my_test(call) }) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-character/scope_line_breaks-in.R b/tests/testthat/scope-character/scope_line_breaks-in.R index 8fd4735e5..22b26a9cf 100644 --- a/tests/testthat/scope-character/scope_line_breaks-in.R +++ b/tests/testthat/scope-character/scope_line_breaks-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-character/scope_line_breaks-out.R b/tests/testthat/scope-character/scope_line_breaks-out.R index 6a8af3216..22b26a9cf 100644 --- a/tests/testthat/scope-character/scope_line_breaks-out.R +++ b/tests/testthat/scope-character/scope_line_breaks-out.R @@ -12,13 +12,15 @@ test_that("x", { # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/scope-character/scope_none-in.R b/tests/testthat/scope-character/scope_none-in.R index 2c770501f..ba9b9f874 100644 --- a/tests/testthat/scope-character/scope_none-in.R +++ b/tests/testthat/scope-character/scope_none-in.R @@ -1,30 +1,33 @@ -#'this function does +#' this function does #' #' @param x a parameter. #' indented comments -a<- function(x){ - test_that("I want to test",{ - out <- c(1,c( - 22 +1 +a <- function(x) { + test_that("I want to test", { + out <- c(1, c( + 22 + 1 )) if (x > 10) { for (x in 22) { # FIXME in operator only to be surrounded by one space. What about %in%? prin(x) } } - } ) - #we like comments too - c(list(x + 2), - c( c( - 26 ^ 2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple + }) + # we like comments too + c( + list(x + 2), + c(c( + 26^2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple 8, 7 - ) ) ) + )) + ) call( 1, 2, - 23+Inf - 99, call( + 23 + Inf - 99, call( 16 - )) + ) + ) } # comments everywhere diff --git a/tests/testthat/scope-character/scope_none-out.R b/tests/testthat/scope-character/scope_none-out.R index 2c770501f..ba9b9f874 100644 --- a/tests/testthat/scope-character/scope_none-out.R +++ b/tests/testthat/scope-character/scope_none-out.R @@ -1,30 +1,33 @@ -#'this function does +#' this function does #' #' @param x a parameter. #' indented comments -a<- function(x){ - test_that("I want to test",{ - out <- c(1,c( - 22 +1 +a <- function(x) { + test_that("I want to test", { + out <- c(1, c( + 22 + 1 )) if (x > 10) { for (x in 22) { # FIXME in operator only to be surrounded by one space. What about %in%? prin(x) } } - } ) - #we like comments too - c(list(x + 2), - c( c( - 26 ^ 2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple + }) + # we like comments too + c( + list(x + 2), + c(c( + 26^2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple 8, 7 - ) ) ) + )) + ) call( 1, 2, - 23+Inf - 99, call( + 23 + Inf - 99, call( 16 - )) + ) + ) } # comments everywhere diff --git a/tests/testthat/scope-character/scope_spaces-in.R b/tests/testthat/scope-character/scope_spaces-in.R index f8a5c9005..9640e4f9e 100644 --- a/tests/testthat/scope-character/scope_spaces-in.R +++ b/tests/testthat/scope-character/scope_spaces-in.R @@ -1,4 +1,4 @@ -a<-function(){ - 1+1 -d=3 - } +a <- function() { + 1 + 1 + d <- 3 +} diff --git a/tests/testthat/scope-character/scope_spaces-out.R b/tests/testthat/scope-character/scope_spaces-out.R index 4036923a9..9640e4f9e 100644 --- a/tests/testthat/scope-character/scope_spaces-out.R +++ b/tests/testthat/scope-character/scope_spaces-out.R @@ -1,4 +1,4 @@ a <- function() { - 1 + 1 -d = 3 - } + 1 + 1 + d <- 3 +} diff --git a/tests/testthat/scope-character/scope_tokens-in.R b/tests/testthat/scope-character/scope_tokens-in.R index 8fd4735e5..22b26a9cf 100644 --- a/tests/testthat/scope-character/scope_tokens-in.R +++ b/tests/testthat/scope-character/scope_tokens-in.R @@ -1,21 +1,26 @@ # adding line-break -if (x) {1 + 1 + +1} else {3} +if (x) { + 1 + 1 + +1 +} else { + 3 +} # removing line-break -test_that("x", - { - my_test(call) - }) +test_that("x", { + my_test(call) +}) # do not replace assignment -a = 3 +a <- 3 data_frame(a = 3) # do not resolve semicolon -a <- function(x) x + 1;b;c +a <- function(x) x + 1 +b +c # don't add brackets in pipes a %>% - b %>% - c + b() %>% + c() diff --git a/tests/testthat/serialize_tests/k2-another-in_file-in.R b/tests/testthat/serialize_tests/k2-another-in_file-in.R index 9f77f05f3..f2133ae9c 100644 --- a/tests/testthat/serialize_tests/k2-another-in_file-in.R +++ b/tests/testthat/serialize_tests/k2-another-in_file-in.R @@ -1,3 +1,7 @@ -call(1, - call2(call(3, 1, 2), - 4)) +call( + 1, + call2( + call(3, 1, 2), + 4 + ) +) diff --git a/tests/testthat/serialize_tests/k2-another-in_file-out.R b/tests/testthat/serialize_tests/k2-another-in_file-out.R index 9f77f05f3..f2133ae9c 100644 --- a/tests/testthat/serialize_tests/k2-another-in_file-out.R +++ b/tests/testthat/serialize_tests/k2-another-in_file-out.R @@ -1,3 +1,7 @@ -call(1, - call2(call(3, 1, 2), - 4)) +call( + 1, + call2( + call(3, 1, 2), + 4 + ) +) diff --git a/tests/testthat/serialize_tests/k2-in.R b/tests/testthat/serialize_tests/k2-in.R index f11cd5450..f2133ae9c 100644 --- a/tests/testthat/serialize_tests/k2-in.R +++ b/tests/testthat/serialize_tests/k2-in.R @@ -1,3 +1,7 @@ -call(1, -call2(call(3, 1, 2), - 4)) +call( + 1, + call2( + call(3, 1, 2), + 4 + ) +) diff --git a/tests/testthat/serialize_tests/k2-out.R b/tests/testthat/serialize_tests/k2-out.R index f11cd5450..f2133ae9c 100644 --- a/tests/testthat/serialize_tests/k2-out.R +++ b/tests/testthat/serialize_tests/k2-out.R @@ -1,3 +1,7 @@ -call(1, -call2(call(3, 1, 2), - 4)) +call( + 1, + call2( + call(3, 1, 2), + 4 + ) +) diff --git a/tests/testthat/serialize_tests/k3-out.R b/tests/testthat/serialize_tests/k3-out.R index e2c34c1f4..5115812b5 100644 --- a/tests/testthat/serialize_tests/k3-out.R +++ b/tests/testthat/serialize_tests/k3-out.R @@ -1,4 +1,8 @@ -#k3 -call(1, -call2(call(3, 1, 2), - 4)) +# k3 +call( + 1, + call2( + call(3, 1, 2), + 4 + ) +) diff --git a/tests/testthat/spacing/colons-in.R b/tests/testthat/spacing/colons-in.R index 40cee9bad..78137413f 100644 --- a/tests/testthat/spacing/colons-in.R +++ b/tests/testthat/spacing/colons-in.R @@ -1,11 +1,11 @@ -1 : 4 +1:4 1:4 -base :: c() +base::c() base::c() -xyz::: xy(3) +xyz:::xy(3) xyz:::xy(3) diff --git a/tests/testthat/spacing/comments-in.R b/tests/testthat/spacing/comments-in.R index a9d1d02e9..7c72225f6 100644 --- a/tests/testthat/spacing/comments-in.R +++ b/tests/testthat/spacing/comments-in.R @@ -1,4 +1,4 @@ a # comment -b #comment -c # comment -dejk #comment +b # comment +c # comment +dejk # comment diff --git a/tests/testthat/spacing/comments-out.R b/tests/testthat/spacing/comments-out.R index a965d0822..7c72225f6 100644 --- a/tests/testthat/spacing/comments-out.R +++ b/tests/testthat/spacing/comments-out.R @@ -1,4 +1,4 @@ a # comment b # comment -c # comment +c # comment dejk # comment diff --git a/tests/testthat/spacing/round_curly-in.R b/tests/testthat/spacing/round_curly-in.R index eeb473495..e49f328b3 100644 --- a/tests/testthat/spacing/round_curly-in.R +++ b/tests/testthat/spacing/round_curly-in.R @@ -1,17 +1,17 @@ -a <- function(x){ +a <- function(x) { } -if(a){ +if (a) { 3 } -for(i in 10){ +for (i in 10) { i } -if(x){ +if (x) { y -}else if(x){ +} else if (x) { x -} else{ +} else { } diff --git a/tests/testthat/spacing/spacing-square-in.R b/tests/testthat/spacing/spacing-square-in.R index 9e0679d40..6fc7288f6 100644 --- a/tests/testthat/spacing/spacing-square-in.R +++ b/tests/testthat/spacing/spacing-square-in.R @@ -1,18 +1,18 @@ a[[2]] -a[[2 ]] +a[[2]] -a[[ 2]] +a[[2]] -a[[ 2 ]] +a[[2]] a[2] -a[2 ] +a[2] -a[ 2] +a[2] -a[ 2 ] +a[2] -a [[2]] -a [1] +a[[2]] +a[1] diff --git a/tests/testthat/spacing/spacing-tilde-in.R b/tests/testthat/spacing/spacing-tilde-in.R index 699899ad7..5f7d6e484 100644 --- a/tests/testthat/spacing/spacing-tilde-in.R +++ b/tests/testthat/spacing/spacing-tilde-in.R @@ -1,9 +1,9 @@ -a~b +a ~ b ~b -~b+ c -a + b ~c +~ b + c +a + b ~ c -a ~b - ~b -~ b+c -a + b~ c +a ~ b +~b +~ b + c +a + b ~ c diff --git a/tests/testthat/spacing/spacing_comma-in.R b/tests/testthat/spacing/spacing_comma-in.R index 26275c7b2..1cb728413 100644 --- a/tests/testthat/spacing/spacing_comma-in.R +++ b/tests/testthat/spacing/spacing_comma-in.R @@ -1 +1 @@ -c( 1, 16 , 333 , 33 , 1) +c(1, 16, 333, 33, 1) diff --git a/tests/testthat/spacing/spacing_comma2-in.R b/tests/testthat/spacing/spacing_comma2-in.R index 156ce20a0..d726bd931 100644 --- a/tests/testthat/spacing/spacing_comma2-in.R +++ b/tests/testthat/spacing/spacing_comma2-in.R @@ -1,2 +1,2 @@ -call(arg ,,more_args) -a[ , , drop = FALSE] +call(arg, , more_args) +a[, , drop = FALSE] diff --git a/tests/testthat/spacing/spacing_function-in.R b/tests/testthat/spacing/spacing_function-in.R index c46669a34..a4a980515 100644 --- a/tests/testthat/spacing/spacing_function-in.R +++ b/tests/testthat/spacing/spacing_function-in.R @@ -1,3 +1,3 @@ -function (x, y, z) { +function(x, y, z) { 3 + 1 } diff --git a/tests/testthat/spacing/spacing_if-in.R b/tests/testthat/spacing/spacing_if-in.R index c3545b0c0..9778ab263 100644 --- a/tests/testthat/spacing/spacing_if-in.R +++ b/tests/testthat/spacing/spacing_if-in.R @@ -1 +1 @@ -if(TRUE) x else y +if (TRUE) x else y diff --git a/tests/testthat/spacing/spacing_in-in.R b/tests/testthat/spacing/spacing_in-in.R index 142dcdc1c..94eb892e1 100644 --- a/tests/testthat/spacing/spacing_in-in.R +++ b/tests/testthat/spacing/spacing_in-in.R @@ -1 +1 @@ -for (i in 3) 3 +for (i in 3) 3 diff --git a/tests/testthat/start_line/comment-out.R b/tests/testthat/start_line/comment-out.R index 93ffe9388..f60af09d6 100644 --- a/tests/testthat/start_line/comment-out.R +++ b/tests/testthat/start_line/comment-out.R @@ -5,5 +5,5 @@ # a comment a <- function(x) { -x + x } diff --git a/tests/testthat/start_line/no_comment-out.R b/tests/testthat/start_line/no_comment-out.R index 940ca4cf2..0e46c7432 100644 --- a/tests/testthat/start_line/no_comment-out.R +++ b/tests/testthat/start_line/no_comment-out.R @@ -4,5 +4,5 @@ a <- function(x) { -x + x } diff --git a/tests/testthat/strict/eol-in.R b/tests/testthat/strict/eol-in.R index 16c24f266..86d6befd5 100644 --- a/tests/testthat/strict/eol-in.R +++ b/tests/testthat/strict/eol-in.R @@ -1,2 +1,2 @@ -a() -b # comment +a() +b # comment diff --git a/tests/testthat/strict/non_strict-in.R b/tests/testthat/strict/non_strict-in.R index bd4895f69..8a8f7b644 100644 --- a/tests/testthat/strict/non_strict-in.R +++ b/tests/testthat/strict/non_strict-in.R @@ -1,41 +1,40 @@ test <- function() { "Double quotes remain as they are" - 'Single quotes are converted to double quotes' - 'even if the string contains an escaped \' single quote' + "Single quotes are converted to double quotes" + "even if the string contains an escaped ' single quote" 'but not if it contains a "double quote' "multi-line quotes remain multi-line " - 'That also holds true + "That also holds true if single quotes are used - .' + ." - 'strings with embedded\nline breaks are handled correctly' + "strings with embedded\nline breaks are handled correctly" - '\\' - '\\\'' - '\\\\' - '\\\\\'' - '\'\\\\\'' + "\\" + "\\'" + "\\\\" + "\\\\'" + "'\\\\'" # Comments are always preserved - function_calls(get_spaces=around_equal) + function_calls(get_spaces = around_equal) - no_space( after_opening( ), paren( (1 + 2))) - no_space (before_opening (), paren ( (1 + 2))) - no_space(before(closing ), paren((1 + 2) ) ) + no_space(after_opening(), paren((1 + 2))) + no_space(before_opening(), paren((1 + 2))) + no_space(before(closing), paren((1 + 2))) multi( line, call ) - multi_line_empty_call( - ) + multi_line_empty_call() - one_space(after,comma("in","function", args)) + one_space(after, comma("in", "function", args)) { braced @@ -52,114 +51,119 @@ test <- function() { call }) - braced("unnamed reduces space", { + braced("unnamed reduces space", { }) - braced("unnamed adds space space",{ + braced("unnamed adds space space", { }) - braced(named_reduces_space = { + braced(named_reduces_space = { }) - braced(named_adds_space = { + braced(named_adds_space = { }) - braced( { + braced({ empty_removes_space }) - a%/%b - a%%b - a&&b - a||b - a==b - a!=b - a<=b - a>=b - a<-b - a->b - a=b - ab - a*b - a/b + a %/% b + a %% b + a && b + a || b + a == b + a != b + a <= b + a >= b + a <- b + a -> b + a <- b + a < b + a > b + a * b + a / b a^b - a&b - a|b - a:=b - - a+b - a-b - a++b - a+-b - a++b - a-+b - a--b - a+--b - a--+b - call( + a) - call( - a) - call(5, + a) - call(5, - a) + a & b + a | b + a := b + + a + b + a - b + a + +b + a + -b + a + +b + a - +b + a - -b + a + --b + a - -+b + call(+a) + call(-a) + call(5, +a) + call(5, -a) # Only with conservative settings: call( preserves, distance, after, commas, - given_has,one + given_has, one ) - if(TRUE){ + if (TRUE) { FALSE } - if(TRUE){ + if (TRUE) { FALSE - }else{ + } else { TRUE } - while(TRUE){ + while (TRUE) { FALSE } - single_line ( "function" ,call ) + single_line("function", call) - multiline ( - "function", call ) + multiline( + "function", call + ) - nested ( function_call ( "in" ,one ,line ) ) + nested(function_call("in", one, line)) - nested ( function_call ( - "in", - multiple,lines ) ) + nested(function_call( + "in", + multiple, lines + )) nested( - function_call ( with ), - many - , first_level_args ) + function_call(with), + many, + first_level_args + ) nested( - function_call ( with ), # a comment and - many #more - , first_level_args ) + function_call(with), # a comment and + many # more + , first_level_args + ) - difficult(nested( - "function", call - ), + difficult( + nested( + "function", call + ), with, more, args ) } # formula -lm(a~b+c,data=NA) -lm(a~.-1,data=NA) -a~b:c -a~b :c -a ~ b : c +lm(a ~ b + c, data = NA) +lm(a ~ . - 1, data = NA) +a ~ b:c +a ~ b:c +a ~ b:c -~ a +~a ~gg -b~ k -call(1,~ qq) +b ~ k +call(1, ~qq) diff --git a/tests/testthat/strict/non_strict-out.R b/tests/testthat/strict/non_strict-out.R index 08f773a73..8a8f7b644 100644 --- a/tests/testthat/strict/non_strict-out.R +++ b/tests/testthat/strict/non_strict-out.R @@ -26,7 +26,7 @@ test <- function() { function_calls(get_spaces = around_equal) no_space(after_opening(), paren((1 + 2))) - no_space (before_opening (), paren ((1 + 2))) + no_space(before_opening(), paren((1 + 2))) no_space(before(closing), paren((1 + 2))) multi( line, @@ -34,7 +34,7 @@ test <- function() { ) multi_line_empty_call() - one_space(after, comma("in", "function", args)) + one_space(after, comma("in", "function", args)) { braced @@ -51,16 +51,16 @@ test <- function() { call }) - braced("unnamed reduces space", { + braced("unnamed reduces space", { }) braced("unnamed adds space space", { }) - braced(named_reduces_space = { + braced(named_reduces_space = { }) - braced(named_adds_space = { + braced(named_adds_space = { }) braced({ @@ -122,31 +122,36 @@ test <- function() { FALSE } - single_line ("function", call) + single_line("function", call) - multiline ( - "function", call) + multiline( + "function", call + ) - nested (function_call ("in", one, line)) + nested(function_call("in", one, line)) - nested (function_call ( + nested(function_call( "in", - multiple, lines)) + multiple, lines + )) nested( - function_call (with), + function_call(with), many, - first_level_args) + first_level_args + ) nested( - function_call (with), # a comment and + function_call(with), # a comment and many # more - , first_level_args) + , first_level_args + ) - difficult(nested( - "function", call - ), - with, more, args + difficult( + nested( + "function", call + ), + with, more, args ) } @@ -156,9 +161,9 @@ lm(a ~ b + c, data = NA) lm(a ~ . - 1, data = NA) a ~ b:c a ~ b:c -a ~ b:c +a ~ b:c ~a ~gg -b ~ k +b ~ k call(1, ~qq) diff --git a/tests/testthat/strict/out-relaxed-target.R b/tests/testthat/strict/out-relaxed-target.R index 69fdcb7a7..e28c5403b 100644 --- a/tests/testthat/strict/out-relaxed-target.R +++ b/tests/testthat/strict/out-relaxed-target.R @@ -9,16 +9,15 @@ test <- function() { function_calls(get_spaces = around_equal) no_space(after_opening(), paren((1 + 2))) - no_space (before_opening (), paren ((1 + 2))) + no_space(before_opening(), paren((1 + 2))) no_space(before(closing), paren((1 + 2))) multi( line, call ) - multi_line_empty_call( - ) + multi_line_empty_call() - one_space(after, comma("in", "function", args)) + one_space(after, comma("in", "function", args)) { braced @@ -35,16 +34,16 @@ test <- function() { call }) - braced("unnamed reduces space", { + braced("unnamed reduces space", { }) braced("unnamed adds space space", { }) - braced(named_reduces_space = { + braced(named_reduces_space = { }) - braced(named_adds_space = { + braced(named_adds_space = { }) braced({ @@ -61,12 +60,12 @@ test <- function() { a >= b a <- b a -> b - a = b + a <- b a < b a > b a * b a / b - a ^ b + a^b a & b a | b a := b @@ -106,30 +105,35 @@ test <- function() { FALSE } - single_line ("function" , call) + single_line("function", call) - multiline ( - "function", call) + multiline( + "function", call + ) - nested (function_call ("in" , one , line)) + nested(function_call("in", one, line)) - nested (function_call ( - "in", - multiple, lines)) + nested(function_call( + "in", + multiple, lines + )) nested( - function_call (with), - many - , first_level_args) + function_call(with), + many, + first_level_args + ) nested( - function_call (with), # a comment and - many #more - , first_level_args) + function_call(with), # a comment and + many # more + , first_level_args + ) - difficult(nested( - "function", call - ), + difficult( + nested( + "function", call + ), with, more, args ) } diff --git a/tests/testthat/strict/out-target.R b/tests/testthat/strict/out-target.R index 0c1c432d9..27cfa027a 100644 --- a/tests/testthat/strict/out-target.R +++ b/tests/testthat/strict/out-target.R @@ -15,8 +15,7 @@ test <- function() { line, call ) - multi_line_empty_call( - ) + multi_line_empty_call() one_space(after, comma("in", "function", args)) @@ -61,12 +60,12 @@ test <- function() { a >= b a <- b a -> b - a = b + a <- b a < b a > b a * b a / b - a ^ b + a^b a & b a | b a := b @@ -106,13 +105,13 @@ test <- function() { FALSE } - single_line("function" , call) + single_line("function", call) multiline( "function", call ) - nested(function_call("in" , one , line)) + nested(function_call("in", one, line)) nested(function_call( "in", @@ -126,8 +125,8 @@ test <- function() { ) nested( - function_call(with), # a comment and - many #more + function_call(with), # a comment and + many # more , first_level_args ) diff --git a/tests/testthat/strict/strict-in.R b/tests/testthat/strict/strict-in.R index ae85a96f5..3422f4e5b 100644 --- a/tests/testthat/strict/strict-in.R +++ b/tests/testthat/strict/strict-in.R @@ -1,24 +1,23 @@ test <- function() { "Double quotes remain as they are" - 'Single quotes are converted to double quotes' - 'even if the string contains an escaped \' single quote' + "Single quotes are converted to double quotes" + "even if the string contains an escaped ' single quote" 'but not if it contains a "double quote' # Comments are always preserved - function_calls(get_spaces=around_equal) + function_calls(get_spaces = around_equal) - no_space( after_opening( ), paren( (1 + 2))) - no_space (before_opening (), paren ( (1 + 2))) - no_space(before(closing ), paren((1 + 2) ) ) + no_space(after_opening(), paren((1 + 2))) + no_space(before_opening(), paren((1 + 2))) + no_space(before(closing), paren((1 + 2))) multi( line, call ) - multi_line_empty_call( - ) + multi_line_empty_call() - one_space(after,comma("in","function", args)) + one_space(after, comma("in", "function", args)) { braced @@ -35,113 +34,118 @@ test <- function() { call }) - braced("unnamed reduces space", { + braced("unnamed reduces space", { }) - braced("unnamed adds space space",{ + braced("unnamed adds space space", { }) - braced(named_reduces_space = { + braced(named_reduces_space = { }) - braced(named_adds_space = { + braced(named_adds_space = { }) - braced( { + braced({ empty_removes_space }) - a%/%b - a%%b - a&&b - a||b - a==b - a!=b - a<=b - a>=b - a<-b - a->b - a=b - ab - a*b - a/b + a %/% b + a %% b + a && b + a || b + a == b + a != b + a <= b + a >= b + a <- b + a -> b + a <- b + a < b + a > b + a * b + a / b a^b - a&b - a|b - a:=b - - a+b - a-b - a++b - a+-b - a++b - a-+b - a--b - a+--b - a--+b - call( + a) - call( - a) - call(5, + a) - call(5, - a) + a & b + a | b + a := b + + a + b + a - b + a + +b + a + -b + a + +b + a - +b + a - -b + a + --b + a - -+b + call(+a) + call(-a) + call(5, +a) + call(5, -a) # Only with conservative settings: call( preserves, distance, after, commas, - given_has,one + given_has, one ) - if(TRUE){ + if (TRUE) { FALSE } - if(TRUE){ + if (TRUE) { FALSE - }else{ + } else { TRUE } - while(TRUE){ + while (TRUE) { FALSE } - single_line ( "function" ,call ) + single_line("function", call) - multiline ( - "function", call ) + multiline( + "function", call + ) - nested ( function_call ( "in" ,one ,line ) ) + nested(function_call("in", one, line)) - nested ( function_call ( - "in", - multiple,lines ) ) + nested(function_call( + "in", + multiple, lines + )) nested( - function_call ( with ), - many - , first_level_args ) + function_call(with), + many, + first_level_args + ) nested( - function_call ( with ), # a comment and - many #more - , first_level_args ) + function_call(with), # a comment and + many # more + , first_level_args + ) - difficult(nested( - "function", call - ), + difficult( + nested( + "function", call + ), with, more, args ) } # formula -lm(a~b+c,data=NA) -lm(a~.-1,data=NA) -a~b:c -a ~ b : c -a~b :c -~ a +lm(a ~ b + c, data = NA) +lm(a ~ . - 1, data = NA) +a ~ b:c +a ~ b:c +a ~ b:c +~a ~gg -b~k -call(1, ~ qq) +b ~ k +call(1, ~qq) diff --git a/tests/testthat/stylerignore/adding-removing-in.R b/tests/testthat/stylerignore/adding-removing-in.R index 4c3516caf..2365ef188 100644 --- a/tests/testthat/stylerignore/adding-removing-in.R +++ b/tests/testthat/stylerignore/adding-removing-in.R @@ -1,8 +1,9 @@ # styler: off -1 +1;3 +1 +1; +1 # styler: on # a comment -c(z ) +c(z) # styler: off @@ -48,13 +49,14 @@ for (i in 1:3) g(i) - 2 # styler: on -1+ 547809 +1 + 547809 -1 +1 # styler: off - -1;1 # styler: off +1 +1 # styler: off; # styler: off # styler: off -1 +1;3 # commnet +1 +1; # commnet + +1 +1 # styler: on diff --git a/tests/testthat/stylerignore/adding-removing-out.R b/tests/testthat/stylerignore/adding-removing-out.R index ce516fe16..e1c6e9440 100644 --- a/tests/testthat/stylerignore/adding-removing-out.R +++ b/tests/testthat/stylerignore/adding-removing-out.R @@ -1,5 +1,5 @@ -# styler: off -1 +1;3 +# styler: off; +1 +1 # styler: on # a comment c(z) @@ -51,10 +51,10 @@ for (i in 1:3) 1 + 547809 -1 +1 # styler: off + # styler: off; # styler: off -1;1 # styler: off +# styler: off; # commnet -# styler: off -1 +1;3 # commnet +1 +1 +1 # styler: on diff --git a/tests/testthat/stylerignore/alignment-in.R b/tests/testthat/stylerignore/alignment-in.R index b128cbac5..684cc008a 100644 --- a/tests/testthat/stylerignore/alignment-in.R +++ b/tests/testthat/stylerignore/alignment-in.R @@ -1,5 +1,5 @@ ps( interaction_constraints = p_uty(tgs = "train"), monotone_constraints = p_uty(dfault = 0, tags = c("train", "control"), custom_check = function(x) { checkmate::check_integerish(x, lower = -1, upper = 1, any.missing = FALSE) }), # styler: off - normalize_type = p_fct(c("tee", "forest"), default = "tree", tags = "train"), + normalize_type = p_fct(c("tee", "forest"), default = "tree", tags = "train"), ) diff --git a/tests/testthat/stylerignore/alignment-out.R b/tests/testthat/stylerignore/alignment-out.R index b128cbac5..684cc008a 100644 --- a/tests/testthat/stylerignore/alignment-out.R +++ b/tests/testthat/stylerignore/alignment-out.R @@ -1,5 +1,5 @@ ps( interaction_constraints = p_uty(tgs = "train"), monotone_constraints = p_uty(dfault = 0, tags = c("train", "control"), custom_check = function(x) { checkmate::check_integerish(x, lower = -1, upper = 1, any.missing = FALSE) }), # styler: off - normalize_type = p_fct(c("tee", "forest"), default = "tree", tags = "train"), + normalize_type = p_fct(c("tee", "forest"), default = "tree", tags = "train"), ) diff --git a/tests/testthat/stylerignore/braces-in.R b/tests/testthat/stylerignore/braces-in.R index 6da0a3b0d..72d284060 100644 --- a/tests/testthat/stylerignore/braces-in.R +++ b/tests/testthat/stylerignore/braces-in.R @@ -1,4 +1,4 @@ -x<- function() +x <- function() 3 # styler: off x<- function() # styler: off diff --git a/tests/testthat/stylerignore/crossing-with-expressions-in.R b/tests/testthat/stylerignore/crossing-with-expressions-in.R index 6c7bb85cc..52cfa0e9f 100644 --- a/tests/testthat/stylerignore/crossing-with-expressions-in.R +++ b/tests/testthat/stylerignore/crossing-with-expressions-in.R @@ -15,6 +15,8 @@ y=1 # none more_calls( # styler: on with( - arguments)) + arguments + ) +) 1 + 1 a(!b) diff --git a/tests/testthat/stylerignore/simple-in.R b/tests/testthat/stylerignore/simple-in.R index f507d8cea..7f8229ebc 100644 --- a/tests/testthat/stylerignore/simple-in.R +++ b/tests/testthat/stylerignore/simple-in.R @@ -17,7 +17,7 @@ a(!b) # -------- x="new" # styler: off -y=1 # none +y <- 1 # none more_calls(with(arguments)) # styler: off diff --git a/tests/testthat/tidyeval/bang_bang-in.R b/tests/testthat/tidyeval/bang_bang-in.R index daa41772a..755c3210f 100644 --- a/tests/testthat/tidyeval/bang_bang-in.R +++ b/tests/testthat/tidyeval/bang_bang-in.R @@ -1,9 +1,9 @@ -nameshift <- c(SL = 'Sepal.Length') -head(dplyr::rename(iris[,1:2], ! ! ! nameshift), 3) -head(dplyr::rename(iris[,1:2],!! ! nameshift), 3) -head(dplyr::rename(iris[,1:2], !!!nameshift), 3) +nameshift <- c(SL = "Sepal.Length") +head(dplyr::rename(iris[, 1:2], ! ! !nameshift), 3) +head(dplyr::rename(iris[, 1:2], !! !nameshift), 3) +head(dplyr::rename(iris[, 1:2], !!!nameshift), 3) my_summarise <- function(df, group_var) { df %>% - group_by( ! ! group_var) %>% + group_by(! !group_var) %>% summarise(a = mean(a)) } diff --git a/tests/testthat/tidyeval/eq_sub_and_comma-in.R b/tests/testthat/tidyeval/eq_sub_and_comma-in.R index 5fb332032..af93f2df5 100644 --- a/tests/testthat/tidyeval/eq_sub_and_comma-in.R +++ b/tests/testthat/tidyeval/eq_sub_and_comma-in.R @@ -1,6 +1,6 @@ a <- function() { data_frame( - b =, - c =, + b = , + c = , ) } diff --git a/tests/testthat/tidyeval/setting_var_names-in.R b/tests/testthat/tidyeval/setting_var_names-in.R index 4df8b8596..5dc74ad3f 100644 --- a/tests/testthat/tidyeval/setting_var_names-in.R +++ b/tests/testthat/tidyeval/setting_var_names-in.R @@ -1,6 +1,6 @@ mtcars %>% group_by(am) %>% summarise( - !!mean_nm:=mean(cyl), - !!count_nm :=n() + !!mean_nm := mean(cyl), + !!count_nm := n() ) diff --git a/tests/testthat/token_adding_removing/add_brackets_in_pipe-in.R b/tests/testthat/token_adding_removing/add_brackets_in_pipe-in.R index a803abadb..3bb029b9f 100644 --- a/tests/testthat/token_adding_removing/add_brackets_in_pipe-in.R +++ b/tests/testthat/token_adding_removing/add_brackets_in_pipe-in.R @@ -1,5 +1,5 @@ 1 %>% 2 1 %x% 1 1 %x% y -1 %>% x +1 %>% x() 1 %s% 1 diff --git a/tests/testthat/token_adding_removing/double_braces-in.R b/tests/testthat/token_adding_removing/double_braces-in.R index 0b65af6bd..4df1c6536 100644 --- a/tests/testthat/token_adding_removing/double_braces-in.R +++ b/tests/testthat/token_adding_removing/double_braces-in.R @@ -1,4 +1,7 @@ -if (X) +if (X) { return(TRUE) +} -if (X) return(FALSE) +if (X) { + return(FALSE) +} diff --git a/tests/testthat/token_adding_removing/for_while_stylerignore-in.R b/tests/testthat/token_adding_removing/for_while_stylerignore-in.R index bd4dbd543..1234fec74 100644 --- a/tests/testthat/token_adding_removing/for_while_stylerignore-in.R +++ b/tests/testthat/token_adding_removing/for_while_stylerignore-in.R @@ -1,19 +1,20 @@ -while(TRUE) +while (TRUE) { 3 +} # styler: off while(TRUE) 3 # styler: on -while(TRUE) +while (TRUE) # styler: off 3 # styler: on for (i # styler: off - in 3) + in 3) 3 # styler: off @@ -31,19 +32,21 @@ for (i for (i - in 3) { + in 3) { 3} # styler: off for (i in 3) {# styler: off - 3} + 3 +} for (i# styler: off - in 3) { - 3} + in 3) { + 3 +} -while( +while ( FALSE ) { # styler: off @@ -51,7 +54,7 @@ while( # styler: on } -while( +while ( FALSE # comment ) { # styler: off @@ -62,12 +65,10 @@ while( while( # styler: off FALSE ) { - 1 - } -while( +while ( # styler: off FALSE ) { diff --git a/tests/testthat/token_adding_removing/if-else-comma-in.R b/tests/testthat/token_adding_removing/if-else-comma-in.R index 40d144c09..4bbf4bdee 100644 --- a/tests/testthat/token_adding_removing/if-else-comma-in.R +++ b/tests/testthat/token_adding_removing/if-else-comma-in.R @@ -1,15 +1,23 @@ call( - if (x) - y, - if(x) + if (x) { + y + }, + if (x) { z + } ) -call(if (x) y , - if(x) z ) +call( + if (x) y, + if (x) z +) -call(if (x) y, - if(x) z ) +call( + if (x) y, + if (x) z +) -call(if (x) y, - if(x) z) +call( + if (x) y, + if (x) z +) diff --git a/tests/testthat/token_adding_removing/if_else_non_strict-in.R b/tests/testthat/token_adding_removing/if_else_non_strict-in.R index ec3aca4fe..b8e1a711d 100644 --- a/tests/testthat/token_adding_removing/if_else_non_strict-in.R +++ b/tests/testthat/token_adding_removing/if_else_non_strict-in.R @@ -1,8 +1,9 @@ { - if (TRUE) + if (TRUE) { 3 -else -5 + } else { + 5 + } } @@ -10,42 +11,54 @@ else if (TRUE) { 3 a + b - }else + } else { 5 + } - c() + c() } { - if (TRUE) + if (TRUE) { 3 - else { + } else { h() - 5 } + 5 + } } { if (TRUE) { 3 - }else { + } else { s() - 5 } + 5 + } } -if (TRUE) - 1 else - 3 +if (TRUE) { + 1 +} else { + 3 +} -if (FALSE) - 1 + a * ( 31/2) else - 3^k +if (FALSE) { + 1 + a * (31 / 2) +} else { + 3^k +} -if (TRUE) - 1+1 else - 3 +if (TRUE) { + 1 + 1 +} else { + 3 +} -if (TRUE) - 1 + 1 else a +4 +if (TRUE) { + 1 + 1 +} else { + a + 4 +} diff --git a/tests/testthat/token_adding_removing/if_else_non_strict-out.R b/tests/testthat/token_adding_removing/if_else_non_strict-out.R index 26362f481..b8e1a711d 100644 --- a/tests/testthat/token_adding_removing/if_else_non_strict-out.R +++ b/tests/testthat/token_adding_removing/if_else_non_strict-out.R @@ -1,8 +1,9 @@ { - if (TRUE) + if (TRUE) { 3 - else + } else { 5 + } } @@ -10,17 +11,18 @@ if (TRUE) { 3 a + b - } else + } else { 5 + } c() } { - if (TRUE) + if (TRUE) { 3 - else { + } else { h() 5 } @@ -36,18 +38,27 @@ } } -if (TRUE) - 1 else +if (TRUE) { + 1 +} else { 3 +} -if (FALSE) - 1 + a * (31 / 2) else +if (FALSE) { + 1 + a * (31 / 2) +} else { 3^k +} -if (TRUE) - 1 + 1 else +if (TRUE) { + 1 + 1 +} else { 3 +} -if (TRUE) - 1 + 1 else a + 4 +if (TRUE) { + 1 + 1 +} else { + a + 4 +} diff --git a/tests/testthat/token_adding_removing/if_else_strict-in.R b/tests/testthat/token_adding_removing/if_else_strict-in.R index ca89baf99..45cae9432 100644 --- a/tests/testthat/token_adding_removing/if_else_strict-in.R +++ b/tests/testthat/token_adding_removing/if_else_strict-in.R @@ -1,8 +1,9 @@ { - if (TRUE) + if (TRUE) { 3 -else -5 + } else { + 5 + } } @@ -10,43 +11,55 @@ else if (TRUE) { 3 a + b - }else + } else { 5 + } - c() + c() } { - if (TRUE) + if (TRUE) { 3 - else { + } else { h() - 5 } + 5 + } } { if (TRUE) { 3 - }else { + } else { s() - 5 } + 5 + } } -if (TRUE) - 1 else +if (TRUE) { + 1 +} else { 3 +} -if (FALSE) - 1 + a * ( 31/2) else +if (FALSE) { + 1 + a * (31 / 2) +} else { 3^k +} -if (TRUE) - 1+1 else - 3 +if (TRUE) { + 1 + 1 +} else { + 3 +} -if (TRUE) - 1 + 1 else a +4 +if (TRUE) { + 1 + 1 +} else { + a + 4 +} diff --git a/tests/testthat/token_adding_removing/if_else_stylerignore-in.R b/tests/testthat/token_adding_removing/if_else_stylerignore-in.R index a52401cdb..2daff00f6 100644 --- a/tests/testthat/token_adding_removing/if_else_stylerignore-in.R +++ b/tests/testthat/token_adding_removing/if_else_stylerignore-in.R @@ -1,6 +1,6 @@ -a =1 -b=3 -k = 9 +a <- 1 +b <- 3 +k <- 9 h <- function() 1 s <- h { @@ -15,7 +15,7 @@ s <- h if (TRUE) { # styler: off 3 a + b - }else + } else 5 # styler: off c() @@ -34,26 +34,30 @@ s <- h { if (TRUE) { 3 # styler: off - }else { + } else { s() - 5 } + 5 + } } if (TRUE) # styler: off 1 else - 3 + 3 if (FALSE) # styler: off - 1 + a * ( 31/2) else - 3^k + 1 + a * (31 / 2) else + 3^k if (TRUE) 1+1 else # styler: off - 3 + 3 -if (TRUE) - 1 + 1 else a +4 +if (TRUE) { + 1 + 1 +} else { + a + 4 +} # styler: off {if (TRUE) diff --git a/tests/testthat/token_adding_removing/mixed_token-in.R b/tests/testthat/token_adding_removing/mixed_token-in.R index c984b805e..e80aafb4d 100644 --- a/tests/testthat/token_adding_removing/mixed_token-in.R +++ b/tests/testthat/token_adding_removing/mixed_token-in.R @@ -1,9 +1,12 @@ # = replaced with <- -a = 3 +a <- 3 data_frame(a = 3) # semicolon -a; b ;c;d +a +b +c +d # quotes @@ -14,9 +17,10 @@ a; b ;c;d # adding brackets in pipes a %>% - b %>% - c + b() %>% + c() # adding brackets in pipes combined with line breaks -a %>% b %>% - c +a %>% + b() %>% + c() diff --git a/tests/testthat/token_adding_removing/substitute-in.R b/tests/testthat/token_adding_removing/substitute-in.R index 83305008d..04b6eb380 100644 --- a/tests/testthat/token_adding_removing/substitute-in.R +++ b/tests/testthat/token_adding_removing/substitute-in.R @@ -1,3 +1,3 @@ -expr <- substitute(airquality %>% FUN_EXPR, env = list(FUN_EXPR = call("FUN_head"))) +expr <- substitute(airquality %>% FUN_EXPR(), env = list(FUN_EXPR = call("FUN_head"))) a %>% - x + x() diff --git a/tests/testthat/token_adding_removing/substitute-out.R b/tests/testthat/token_adding_removing/substitute-out.R index 415d84d87..04b6eb380 100644 --- a/tests/testthat/token_adding_removing/substitute-out.R +++ b/tests/testthat/token_adding_removing/substitute-out.R @@ -1,3 +1,3 @@ -expr <- substitute(airquality %>% FUN_EXPR, env = list(FUN_EXPR = call("FUN_head"))) +expr <- substitute(airquality %>% FUN_EXPR(), env = list(FUN_EXPR = call("FUN_head"))) a %>% x() diff --git a/tests/testthat/unary_spacing/unary_complex-in.R b/tests/testthat/unary_spacing/unary_complex-in.R index b8518a7dd..ee47ae302 100644 --- a/tests/testthat/unary_spacing/unary_complex-in.R +++ b/tests/testthat/unary_spacing/unary_complex-in.R @@ -1,2 +1,2 @@ -1+(1 - (- (- 3 + 11++ 1) ) -4)--40 -1+(1-(-(-3+11++1))-4)--40 +1 + (1 - (-(-3 + 11 + +1)) - 4) - -40 +1 + (1 - (-(-3 + 11 + +1)) - 4) - -40 diff --git a/tests/testthat/unary_spacing/unary_indention-in.R b/tests/testthat/unary_spacing/unary_indention-in.R index ce299bd27..0a70a334d 100644 --- a/tests/testthat/unary_spacing/unary_indention-in.R +++ b/tests/testthat/unary_spacing/unary_indention-in.R @@ -1,17 +1,17 @@ - 1 + - 2 / - 8/ - 5 + -13 +1 + + 2 / + 8 / + 5 + + 13 1 + - + 1 - --1 / - 27 / - - 3 + +1 - + -1 / + 27 / + -3 1 / 2 + 33 * - 2 + 2 diff --git a/tests/testthat/unary_spacing/unary_simple-in.R b/tests/testthat/unary_spacing/unary_simple-in.R index aff31f5dd..c191ae9c4 100644 --- a/tests/testthat/unary_spacing/unary_simple-in.R +++ b/tests/testthat/unary_spacing/unary_simple-in.R @@ -1 +1 @@ -1+-1/2-3--3++3 +1 + -1 / 2 - 3 - -3 + +3 diff --git a/tests/testthat/unindention/mixed-in.R b/tests/testthat/unindention/mixed-in.R index 5a00a8b16..988599b9b 100644 --- a/tests/testthat/unindention/mixed-in.R +++ b/tests/testthat/unindention/mixed-in.R @@ -1,15 +1,12 @@ { ((( - 2 - ))) - } - -{ -{ - call( - call1(2, 3), - { - sin(cos(pi)) - } ) - } + 2 + ))) } + +{{ call( + call1(2, 3), + { + sin(cos(pi)) + } +) }} diff --git a/tests/testthat/unindention/mixed-out.R b/tests/testthat/unindention/mixed-out.R index 9c543fdf8..988599b9b 100644 --- a/tests/testthat/unindention/mixed-out.R +++ b/tests/testthat/unindention/mixed-out.R @@ -4,13 +4,9 @@ ))) } -{ +{{ call( + call1(2, 3), { - call( - call1(2, 3), - { - sin(cos(pi)) - } - ) + sin(cos(pi)) } -} +) }} diff --git a/tests/testthat/unindention/unindent_multi_line-in.R b/tests/testthat/unindention/unindent_multi_line-in.R index f36f6f097..79a9aae59 100644 --- a/tests/testthat/unindention/unindent_multi_line-in.R +++ b/tests/testthat/unindention/unindent_multi_line-in.R @@ -1,10 +1,12 @@ call( engine, xetex = { - x - }, - luatex= { - x - },{ - xx - } ) # FIXME: line break after '}', see also #125 + x + }, + luatex = { + x + }, + { + xx + } +) # FIXME: line break after '}', see also #125 diff --git a/tests/testthat/unindention/unindent_multi_line-out.R b/tests/testthat/unindention/unindent_multi_line-out.R index d549c1202..79a9aae59 100644 --- a/tests/testthat/unindention/unindent_multi_line-out.R +++ b/tests/testthat/unindention/unindent_multi_line-out.R @@ -5,6 +5,8 @@ call( }, luatex = { x - }, { + }, + { xx -}) # FIXME: line break after '}', see also #125 + } +) # FIXME: line break after '}', see also #125 diff --git a/tests/testthat/unindention/vec_with_fun-in.R b/tests/testthat/unindention/vec_with_fun-in.R index 865af2fa1..a827b8186 100644 --- a/tests/testthat/unindention/vec_with_fun-in.R +++ b/tests/testthat/unindention/vec_with_fun-in.R @@ -1,3 +1,3 @@ -c(a= function() { - 33 - }) +c(a = function() { + 33 +}) diff --git a/tests/testthat/unindention_regex/random_non_comment_indention-in.R b/tests/testthat/unindention_regex/random_non_comment_indention-in.R index 93765f829..253037276 100644 --- a/tests/testthat/unindention_regex/random_non_comment_indention-in.R +++ b/tests/testthat/unindention_regex/random_non_comment_indention-in.R @@ -1,4 +1,4 @@ a <- function() { - bbx + bbx x - } +} diff --git a/tests/testthat/unindention_regex/random_non_comment_indention-out.R b/tests/testthat/unindention_regex/random_non_comment_indention-out.R index 0dceb2ca5..253037276 100644 --- a/tests/testthat/unindention_regex/random_non_comment_indention-out.R +++ b/tests/testthat/unindention_regex/random_non_comment_indention-out.R @@ -1,4 +1,4 @@ a <- function() { - bbx + bbx x } diff --git a/tests/testthat/unindention_regex/regex_force_with_pattern-in.R b/tests/testthat/unindention_regex/regex_force_with_pattern-in.R index 65cc75545..d7c6cfca5 100644 --- a/tests/testthat/unindention_regex/regex_force_with_pattern-in.R +++ b/tests/testthat/unindention_regex/regex_force_with_pattern-in.R @@ -1,9 +1,9 @@ # ____________________________________________________________________________ # level 1 #### a <- function() { - ### . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. - ### inside the function should not be indented #### - q() - ## ............................................................................ + ### . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. + ### inside the function should not be indented #### + q() + ## ............................................................................ ## same here #### } diff --git a/tests/testthat/unindention_regex/regex_force_with_pattern-out.R b/tests/testthat/unindention_regex/regex_force_with_pattern-out.R index 3386ae756..d7c6cfca5 100644 --- a/tests/testthat/unindention_regex/regex_force_with_pattern-out.R +++ b/tests/testthat/unindention_regex/regex_force_with_pattern-out.R @@ -1,9 +1,9 @@ # ____________________________________________________________________________ # level 1 #### a <- function() { -### . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. -### inside the function should not be indented #### + ### . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. + ### inside the function should not be indented #### q() -## ............................................................................ -## same here #### + ## ............................................................................ + ## same here #### }