Appsilon / box.linters

lintr-compatible linters for box modules in R
https://appsilon.github.io/box.linters/
4 stars 0 forks source link

Handle objects in {glue} string templates #97

Closed radbasa closed 1 month ago

radbasa commented 1 month ago

Closes #96

Description

Does not handle an edge case described in glue unit tests:

test_that("glue works with complex expressions", {
  `foo}\`` <- "foo"

  expect_equal(glue("{
      {
        '}\\'' # { and } in comments, single quotes
        \"}\\\"\" # or double quotes are ignored
        `foo}\\`` # as are { in backticks
      }
  }"),
  `foo}\``)
})

https://github.com/tidyverse/glue/blob/9f88e2179fc7aa6ff11214271fd61bba169f925c/tests/testthat/test-glue.R#L76-L87

Definition of Done

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.36%. Comparing base (fb22413) to head (db2730f). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #97 +/- ## ========================================== + Coverage 98.31% 98.36% +0.05% ========================================== Files 20 21 +1 Lines 770 797 +27 ========================================== + Hits 757 784 +27 Misses 13 13 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.