Check that no absolute paths are used (e.g. "/var", "C:\System", "~/docs").
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = 'R"--[/blah/file.txt]--"',
linters = absolute_path_linter()
)
#> <text>:1:2: warning: [absolute_path_linter] Do not use absolute paths.
#> R"--[/blah/file.txt]--"
#> ^~~~~~~~~~~~~~~~~~~~~
# okay
lint(
text = 'R"(./blah)"',
linters = absolute_path_linter()
)
#> ℹ No lints found.