Check for usage of unavailable functions. Not reliable for testing r-devel dependencies.
Usage
backport_linter(r_version = getRversion(), except = character())
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "trimws(x)",
linters = backport_linter("3.0.0")
)
#> <text>:1:1: warning: [backport_linter] trimws (R 3.2.0) is not available for dependency R >= 3.0.0.
#> trimws(x)
#> ^~~~~~
lint(
text = "str2lang(x)",
linters = backport_linter("3.2.0")
)
#> <text>:1:1: warning: [backport_linter] str2lang (R 3.6.0) is not available for dependency R >= 3.2.0.
#> str2lang(x)
#> ^~~~~~~~
# okay
lint(
text = "trimws(x)",
linters = backport_linter("3.6.0")
)
#> ℹ No lints found.
lint(
text = "str2lang(x)",
linters = backport_linter("4.0.0")
)
#> ℹ No lints found.
lint(
text = "str2lang(x)",
linters = backport_linter("3.2.0", except = "str2lang")
)
#> ℹ No lints found.