-
Notifications
You must be signed in to change notification settings - Fork 3
/
.Rprofile
61 lines (55 loc) · 1.38 KB
/
.Rprofile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# nolint start
source("renv/activate.R")
if (Sys.getenv("CI") == "") { # not CI
if (Sys.getenv("RSTUDIO") == "") {
suppressMessages(if (requireNamespace("languageserver")) {
a <- try(suppressWarnings(source(file.path(
Sys.getenv(if (.Platform$OS.type == "windows") {
"USERPROFILE"
} else {
"HOME"
}),
".vscode-R",
"init.R"
))),
silent = TRUE
)
rm(a)
})
}
if (interactive()) {
options(
warnPartialMatchArgs = FALSE,
warnPartialMatchDollar = FALSE,
warnPartialMatchAttr = FALSE,
usethis.protocol = "https",
vsc.rstudioapi = TRUE
# error = recover
)
suppressMessages(
suppressWarnings({
require("testthat", quietly = TRUE)
require("devtools", quietly = TRUE)
require("usethis", quietly = TRUE)
require("conflicted", quietly = TRUE)
require("here", quietly = TRUE)
})
)
# suppressMessages(prettycode::prettycode())
if (suppressMessages(requireNamespace("prompt", quietly = TRUE))) {
prompt::set_prompt(function(...) {
paste0(
"[",
prompt::git_branch(),
prompt::git_dirty(),
prompt::git_arrows(),
"] ",
prompt::prompt_runtime()
)
})
}
}
} else { # is CI
message("Running .RProfile in CI")
}
# nolint end