-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Labels
Milestone
Description
Now that we have a series of consistency checks built into Lint():
Lines 374 to 395 in f8bb91e
| if (!missing(linter)) { | |
| lintr_deprecated( | |
| old = "Using the `linter` argument of `Lint()`", | |
| version = "3.0.0", | |
| type = "" | |
| ) | |
| } | |
| if (length(line) != 1L || !is.character(line)) { | |
| stop("`line` must be a string.") | |
| } | |
| max_col <- max(nchar(line) + 1L, 1L, na.rm = TRUE) | |
| if (!is_number(column_number) || column_number < 0L || column_number > max_col) { | |
| stop(sprintf( | |
| "`column_number` must be an integer between 0 and nchar(line) + 1 (%d). It was %s.", | |
| max_col, column_number | |
| )) | |
| } | |
| if (!is_number(line_number) || line_number < 1L) { | |
| stop(sprintf("`line_number` must be a positive integer. It was %s.", line_number)) | |
| } | |
| check_ranges(ranges, max_col) |
It may make sense to offer a vectorized interface for constructing lints so these consistency checks can be vectorized for efficiency, rather than running the checks lint-by-lint.