Skip to content

Commit

Permalink
nzchar_linter too
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed May 9, 2024
1 parent eedd1ba commit b7c886d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .ci/.lintr.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ linters = c(dt_linters, all_linters(
todo_comment_linter = NULL,
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
brace_linter = NULL,
condition_call_linter = NULL,
fixed_regex_linter = NULL,
if_not_else_linter = NULL,
implicit_assignment_linter = NULL,
implicit_integer_linter = NULL,
keyword_quote_linter = NULL,
nzchar_linter = NULL,
object_overwrite_linter = NULL,
paren_body_linter = NULL,
redundant_equals_linter = NULL,
Expand Down Expand Up @@ -98,6 +96,7 @@ exclusions = c(local({
undesirable_operator_linter = Inf, # For ':::', possibly we could be more careful to only exclude ':::'.
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
comparison_negation_linter = Inf,
condition_call_linter = Inf,
duplicate_argument_linter = Inf,
equals_na_linter = Inf,
missing_argument_linter = Inf,
Expand Down
2 changes: 1 addition & 1 deletion inst/tests/benchmark.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ out = capture.output(print(DT))
tt = out[grep("V",out)]
tt = unlist(strsplit(gsub(" ","",tt), "V"))
test(1982.1, tt[1L], "")
tt = as.integer(tt[tt!=""])
tt = as.integer(tt[nzchar(tt)])
test(1982.2, tt, seq_along(tt))

# fread leak, #3292
Expand Down
4 changes: 2 additions & 2 deletions inst/tests/other.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ if (loaded[["yaml"]]) { # csvy; #1701. Was 2032-2033 in tests.Rraw, #5516
fwrite(DT, f<-tempfile(), bom=TRUE, yaml=TRUE)
fcon = file(f, encoding="UTF-8") # Windows readLines needs to be told; see also test 1658.50 in tests.Rraw
lines = readLines(fcon)
lines = lines[lines!=""] # an extra "" after "eol: |2+" (line 16) on Linux but not Windows
lines = lines[nzchar(lines)] # an extra "" after "eol: |2+" (line 16) on Linux but not Windows
# remove the blank here so we don't need to change this test if/when that changes in yaml package
test(17.11, length(lines), 48L)
close(fcon)
Expand All @@ -417,7 +417,7 @@ if (loaded[["yaml"]]) { # csvy; #1701. Was 2032-2033 in tests.Rraw, #5516
fwrite(DT, f<-tempfile(), bom=TRUE, yaml=TRUE)
fcon = file(f, encoding="UTF-8")
lines = readLines(fcon)
lines = lines[lines!=""]
lines = lines[nzchar(lines)]
test(17.13, length(lines), 48L)
close(fcon)
test(17.14, fread(f), DT)
Expand Down

0 comments on commit b7c886d

Please sign in to comment.