Skip to content

Commit

Permalink
Merge branch 'main' into f209-newline-multiline-args
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored Dec 9, 2024
2 parents 58acf35 + 4e3bc30 commit 27b5eca
Show file tree
Hide file tree
Showing 62 changed files with 360 additions and 364 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.7.1
uses: JamesIves/github-pages-deploy-action@v4.7.2
with:
clean: false
branch: gh-pages
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Suggests:
roxygen2,
rstudioapi (>= 0.7),
tibble (>= 1.4.2),
testthat (>= 3.0.0)
testthat (>= 3.2.1)
VignetteBuilder:
knitr
Encoding: UTF-8
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-curly-curly.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("curly-culry", {
expect_warning(test_collection("curly-curly",
expect_no_warning(test_collection("curly-curly",
"mixed",
transformer = style_text
), NA)
))
})
6 changes: 3 additions & 3 deletions tests/testthat/test-detect-alignment.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
test_that("does apply spacing rules only if not aligned", {
expect_warning(test_collection("alignment",
expect_no_warning(test_collection("alignment",
transformer = style_text
), NA)
))

text <- "tribble(\n ~x, ~y,\n 11, list(a = 1),\n 2, list(bjj = 2)\n)"
expect_warning(style_text(text), NA)
expect_no_warning(style_text(text))
})
4 changes: 2 additions & 2 deletions tests/testthat/test-escaping.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_that("escaping of characters works", {
expect_warning(test_collection("escaping", "basic",
expect_no_warning(test_collection("escaping", "basic",
transformer = style_text
), NA)
))

expect_error(test_collection("escaping", "fail-parsing-1",
transformer = style_text
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-fun_dec.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
test_that("reindent function declaration", {
expect_warning(test_collection("fun_dec", "fun_dec_scope_spaces",
expect_no_warning(test_collection("fun_dec", "fun_dec_scope_spaces",
transformer = style_text, scope = "spaces"
), NA)
))

expect_warning(test_collection("fun_dec", "line_break_fun_dec",
expect_no_warning(test_collection("fun_dec", "line_break_fun_dec",
transformer = style_text
), NA)
))
})
24 changes: 12 additions & 12 deletions tests/testthat/test-indention_curly.R
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
test_that("indention on one-liner curley only is not changed", {
expect_warning(test_collection("indention_curly_brackets",
expect_no_warning(test_collection("indention_curly_brackets",
"one_line_curly",
transformer = style_text
), NA)
))
})

test_that("indention with multi-line curley only is correct", {
expect_warning(test_collection("indention_curly_brackets",
expect_no_warning(test_collection("indention_curly_brackets",
"multi_line_curly_only",
transformer = style_text_without_curly_curly
), NA)
))
})


test_that("indention with multi-line curley and round is correct", {
expect_warning(test_collection("indention_curly_brackets",
expect_no_warning(test_collection("indention_curly_brackets",
"multi_line_curly_round_only",
transformer = style_text
), NA)
))
})

test_that("custom indention for curly braces is corretct ", {
expect_warning(test_collection("indention_curly_brackets",
expect_no_warning(test_collection("indention_curly_brackets",
"custom",
transformer = style_text, indent_by = 4
), NA)
))
})


Expand All @@ -33,13 +33,13 @@ test_that(paste(
"complete styling via top-level api is correct",
"(round, curly, spacing)"
), {
expect_warning(test_collection("indention_curly_brackets",
expect_no_warning(test_collection("indention_curly_brackets",
"multi_line_curly_round_spacing",
transformer = style_text
), NA)
))

expect_warning(test_collection("indention_curly_brackets",
expect_no_warning(test_collection("indention_curly_brackets",
"multi_line_curly_while_for_if_fun",
transformer = style_text
), NA)
))
})
4 changes: 2 additions & 2 deletions tests/testthat/test-indention_fun_calls.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("edge cases work", {
expect_warning(test_collection("indention_fun_calls",
expect_no_warning(test_collection("indention_fun_calls",
transformer = style_text, strict = FALSE
), NA)
))
})
32 changes: 16 additions & 16 deletions tests/testthat/test-indention_multiple.R
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
test_that("multiple round brackets don't cause extraindention", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"round_only",
transformer = style_text
), NA)
))

expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"round_closing_on_same_line",
transformer = style_text
), NA)
))
})


test_that("multiple curly brackets don't cause extraindention", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"curly_only",
transformer = style_text_without_curly_curly
), NA)
))
})


test_that("multiple curly and round brackets don't cause extraindention", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"curly_and_round",
transformer = style_text_without_curly_curly
), NA)
))
})



test_that("multiple curly and round brackets overall test", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"overall",
transformer = style_text
), NA)
))
})

test_that("if and ifelse interacting with curly braces works", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"if_else_curly",
transformer = style_text, strict = FALSE
), NA)
))
})

test_that("edge cases work", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"edge_strict",
transformer = style_text_without_curly_curly
), NA)
))
})

test_that("token / braces interaction works", {
expect_warning(test_collection("indention_multiple",
expect_no_warning(test_collection("indention_multiple",
"fun_for_new_line",
transformer = style_text_without_curly_curly
), NA)
))
})
Loading

0 comments on commit 27b5eca

Please # to comment.