# will produce lints
lint(
text = "if (any(x == TRUE)) 1",
linters = redundant_equals_linter()
)
lint(
text = "if (any(x != FALSE)) 0",
linters = redundant_equals_linter()
)
lint(
text = "dt[is_tall == FALSE, y]",
linters = redundant_equals_linter()
)
# okay
lint(
text = "if (any(x)) 1",
linters = redundant_equals_linter()
)
lint(
text = "if (!all(x)) 0",
linters = redundant_equals_linter()
)
# in `{data.table}` semantics, `dt[x]` is a join, `dt[(x)]` is a subset
lint(
text = "dt[(!is_tall), y]",
linters = redundant_equals_linter()
)
Run the code above in your browser using DataLab