# will produce lints
lint(
text = "expect_true(x && y)",
linters = conjunct_test_linter()
)
lint(
text = "expect_false(x || (y && z))",
linters = conjunct_test_linter()
)
lint(
text = "stopifnot('x must be a logical scalar' = length(x) == 1 && is.logical(x) && !is.na(x))",
linters = conjunct_test_linter(allow_named_stopifnot = FALSE)
)
# okay
lint(
text = "expect_true(x || (y && z))",
linters = conjunct_test_linter()
)
lint(
text = 'stopifnot("x must be a logical scalar" = length(x) == 1 && is.logical(x) && !is.na(x))',
linters = conjunct_test_linter(allow_named_stopifnot = TRUE)
)
Run the code above in your browser using DataLab