Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LINT_BUG]: unused object in data.table scope #140

Open
Gotfrid opened this issue Sep 2, 2024 · 2 comments
Open

[LINT_BUG]: unused object in data.table scope #140

Gotfrid opened this issue Sep 2, 2024 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Gotfrid
Copy link
Member

Gotfrid commented Sep 2, 2024

box.linters version

0.10.2

Sample source code to lint

threshold <- 0.5
data <- data.table::data.table(value = c(0.3, 0.6))
data[, color_level := ifelse(value <= threshold, 1, 0)]

Lint command used

rhino::lint_r()

Lint result

app/logic/utils.R:39:10: warning: [unused_declared_object_linter] Declared function/object unused.
  data[, color_level := ifelse(value <= threshold, 1, 0)]
         ^~~~~~~~~~~

Expected result

No linter issues.

@shahreyar-abeer
Copy link

Hi,

I'd like to report a similar issue with the dot(.) operator in {data.table}

box.linters version

0.10.0

sample source code to lint

box::use(
  data.table[data.table, ],
)

d1 <- data.table(v = 1:9)
d1[, .(sum(v))]

lint result

Line 6 [box_usage_linter] Function not imported nor defined.

expected result

No linter issues

@radbasa
Copy link
Collaborator

radbasa commented Sep 13, 2024

This looks like custom special handlers for {data.table} are needed.

@radbasa radbasa added bug Something isn't working enhancement New feature or request labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants