Check that the line length of both comments and code is less than length
.
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = strrep("x", 23L),
linters = line_length_linter(length = 20L)
)
#> <text>:1:21: style: [line_length_linter] Lines should not be more than 20 characters. This line is 23 characters.
#> xxxxxxxxxxxxxxxxxxxxxxx
#> ~~~~~~~~~~~~~~~~~~~~^~~
# okay
lint(
text = strrep("x", 21L),
linters = line_length_linter(length = 40L)
)
#> ℹ No lints found.