Appsilon / box.linters

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

[LINT_BUG]: Lints on box recommended method of testing interfaces #98

Closed radbasa closed 4 months ago

radbasa commented 4 months ago

box.linters version

0.9.0

Sample source code to lint

Second method in https://klmr.me/box/articles/testing.html#test-interfaces-not-implementation-details

box::use(path/to/module_a)

impl = attr(module_a, 'namespace')

test_that('implementation detail X works', {
    expect_true(impl$this_works())
})

Lint command used

lintr::lint( code, linters = lintr::linters_with_defaults(defaults = box.linters::rhino_default_linters) )

Lint result

<text>:2:10: warning: [box.linters::box_unused_attached_mod_linter] Attached module unused.
box::use(path/to/module_a)
         ^~~~~~~~~~~~~~~~

Expected result

This should not lint.