Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ linters: all_linters(
todo_comment_linter = NULL,
nonportable_path_linter = NULL,
string_boundary_linter = NULL,
strings_as_factors_linter = NULL, # since we use R >= 4.0
undesirable_function_linter = NULL,
undesirable_operator_linter = NULL
)
Expand Down
3 changes: 1 addition & 2 deletions R/token-define.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ token <- rbind.data.frame(
c("if", "cond", "IF"),
c("else", "cond", "ELSE"),
c("in", "loop_cond", "IN"),
c("while", "loop_cond", "WHILE"),
stringsAsFactors = FALSE
c("while", "loop_cond", "WHILE")
)
# styler: on

Expand Down
3 changes: 1 addition & 2 deletions R/ui-caching.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ cache_info <- function(cache_name = NULL, format = "both") {
last_modified = suppressWarnings(max(file_info$mtime)),
created = file.info(path_cache)$ctime,
location = path_cache,
activated = cache_is_activated(cache_name),
stringsAsFactors = FALSE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IINM this is not WAI anyway?

styler:::styler_df(a = 1:10, b = 11:20, stringsAsFactors=FALSE)
    a  b stringsAsFactors
1   1 11            FALSE
2   2 12            FALSE
3   3 13            FALSE
4   4 14            FALSE
5   5 15            FALSE
6   6 16            FALSE
7   7 17            FALSE
8   8 18            FALSE
9   9 19            FALSE
10 10 20            FALSE

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true!

activated = cache_is_activated(cache_name)
)

if (any(c("lucid", "both") == format)) {
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ re_match <- function(text, pattern) {
end <- start + length - 1L
matchstr <- substring(text, start, end)
matchstr[start == -1L] <- NA_character_
res <- data.frame(stringsAsFactors = FALSE, .text = text, .match = matchstr)
res <- data.frame(.text = text, .match = matchstr)

gstart <- attr(match, "capture.start")
glength <- attr(match, "capture.length")
gend <- gstart + glength - 1L
groupstr <- substring(text, gstart, gend)
groupstr[gstart == -1L] <- NA_character_
dim(groupstr) <- dim(gstart)
res <- cbind(groupstr, res, stringsAsFactors = FALSE)
res <- cbind(groupstr, res)

names(res) <- c(attr(match, "capture.names"), ".text", ".match")
res
Expand Down