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]: box_usage_linter false positive when mixing packages with scripts in box::use #150

Open TymekDev opened 1 month ago

TymekDev commented 1 month ago

box.linters version

v0.10.5

Sample source code to lint

box::use(
  app/main,
  shiny[shinyApp],
)

shinyApp(main$ui, main$server)

Lint command used

code <- "box::use(
  app/main,
  shiny[shinyApp],
)

shinyApp(main$ui, main$server)"

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

Lint result

<text>:7:1: warning: [box_usage_linter] Function not imported nor defined.
shinyApp(main$ui, main$server)
^~~~~~~~

Expected result

I expected to not receive a lint as shinyApp is imported.

radbasa commented 1 month ago

I'm surprised the box_separate_calls_linter did not throw lint.

https://appsilon.github.io/box.linters/reference/box_separate_calls_linter.html