Skip to contents

Check that the line length of both comments and code is less than length.

Usage

line_length_linter(length = 80L)

Arguments

length

maximum line length allowed. Default is 80L (Hollerith limit).

See also

Examples

# will produce lints
lint(
  text = strrep("x", 23L),
  linters = line_length_linter(length = 20L)
)
#> ::warning file=<text>,line=1,col=21::file=<text>,line=1,col=21,[line_length_linter] Lines should not be more than 20 characters. This line is 23 characters.

# okay
lint(
  text = strrep("x", 21L),
  linters = line_length_linter(length = 40L)
)