-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating Rprofile and adding dfeshiny
- Loading branch information
Showing
3 changed files
with
66 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,40 @@ | ||
source("renv/activate.R") | ||
# --------------------------------------------------------- | ||
# This is the .Rprofile file | ||
# | ||
# Use it to include any functions you want to run before any other code is run. | ||
# For example, using renv automatically sources its activate script to the .RProfile file | ||
# This ensures that all renv checks on package versions happens before any code is run. | ||
# | ||
# | ||
# --------------------------------------------------------- | ||
|
||
shhh <- suppressPackageStartupMessages # It's a library, so shhh! | ||
cat("Sourcing .Rprofile.", fill = TRUE) | ||
|
||
source("renv/activate.R") | ||
|
||
tidy_code <- function() { | ||
shhh(source("global.r")) | ||
shhh(tidy_code_function()) | ||
if (system.file(package = "dfeshiny") != "") { | ||
library(dfeshiny) | ||
} else { | ||
warning("dfeshiny package is not installed, please run renv::restore() to set up the necessary package environment") | ||
} | ||
|
||
# Function to run tests | ||
run_tests_locally <- function() { | ||
Sys.unsetenv("http_proxy") | ||
Sys.unsetenv("https_proxy") | ||
shhh(source("global.R")) | ||
source("global.r") | ||
# message("================================================================================") | ||
# message("== testthat ====================================================================") | ||
# message("") | ||
# shhh(testthat::test_dir("tests/testthat")) | ||
# testthat::test_dir("tests/testthat") | ||
# message("") | ||
message("================================================================================") | ||
message("== shinytest ===================================================================") | ||
message("== shinytest2 ==================================================================") | ||
message("") | ||
shhh(shinytest::testApp()) | ||
shinytest2::test_app() | ||
message("") | ||
message("================================================================================") | ||
} | ||
|
||
# Install commit-hooks locally | ||
statusWriteCommit <- file.copy(".hooks/pre-commit.R", ".git/hooks/pre-commit", overwrite = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters