-
Notifications
You must be signed in to change notification settings - Fork 65
/
.lintr
33 lines (33 loc) · 1.24 KB
/
.lintr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
exclusions: list(
"inst/doc/evals.R",
"inst/doc/knitr.R",
"inst/doc/pander.R",
"inst/doc/pandoc_table.R",
"R/RcppExports.R",
"R/S3.R" = c(257, 258, 259)
)
linters: with_defaults(
line_length_linter(120),
camel_case_linter = NULL,
snake_case_linter = NULL,
multiple_dots_linter = NULL,
commented_code_linter = NULL, # 114
spaces_left_parentheses_linter = NULL, # 6
double_quotes_linter = NULL,
single_quotes_linter = function(source_file) {
lapply(ids_with_token(source_file, "STR_CONST"),
function(id) {
parsed <- with_id(source_file, id)
if (re_matches(parsed$text, rex(start, double_quote, any_non_single_quotes, double_quote, end))) {
Lint(
filename = source_file$filename,
line_number = parsed$line1,
column_number = parsed$col1,
type = "style",
message = "Only use single-quotes.",
line = source_file$lines[as.character(parsed$line1)],
ranges = list(c(parsed$col1, parsed$col2)),
linter = "double_quotes_linter"
)}})},
NULL
)