Skip to content

Commit e00f0a7

Browse files
With #276, we can now indent EQ_ASSIGN correclty.
1 parent e9e7202 commit e00f0a7

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

R/indent.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ indent_op <- function(pd,
2727
logical_token,
2828
special_token,
2929
"LEFT_ASSIGN",
30+
"EQ_ASSIGN",
3031
"'$'")
3132
) {
3233
indent_indices <- compute_indent_indices(pd, token)

man/update_indention.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/indention_operators/logical_special_eq_sub-in.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ data_frame(
1414
a =
1515
list()
1616
)
17+
b =
18+
3

tests/testthat/indention_operators/logical_special_eq_sub-in_tree

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/indention_operators/logical_special_eq_sub-out.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ data_frame(
1414
a =
1515
list()
1616
)
17+
b =
18+
3

tests/testthat/test-indention_operators.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ test_that("while / for / if without curly brackets", {
2424
transformer = style_text, strict = FALSE), NA)
2525
})
2626

27-
test_that("logical, special and EQ_SUB tokens are indented correctly", {
27+
test_that("logical, special EQ_SUB and EQ_ASSIGN tokens are indented correctly", {
2828
expect_warning(test_collection("indention_operators",
2929
"logical_special",
30-
transformer = style_text), NA)
30+
transformer = style_text, scope = "line_breaks"), NA)
3131

3232
expect_warning(test_collection("indention_operators",
3333
"eq",

0 commit comments

Comments
 (0)