Skip to content

Commit

Permalink
Updating Rprofile and adding dfeshiny
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbielby committed May 17, 2024
1 parent 777d529 commit 4404abe
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 97 deletions.
32 changes: 23 additions & 9 deletions .Rprofile
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)
1 change: 1 addition & 0 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ shhh(library(networkD3))
shhh(library(styler))
shhh(library(shinyGovstyle))
shhh(library(shinyjs))
shhh(library(dfeshiny))
# shhh(library(shinya11y))

# update years for text
Expand Down
130 changes: 42 additions & 88 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@
],
"Hash": "45f0398006e83a5b10b72a90663d8d8c"
},
"RCurl": {
"Package": "RCurl",
"Version": "1.98-1.14",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"bitops",
"methods"
],
"Hash": "47f648d288079d0c696804ad4e55197e"
},
"Rcpp": {
"Package": "Rcpp",
"Version": "1.0.12",
Expand Down Expand Up @@ -283,16 +295,6 @@
],
"Hash": "cad6cf7f1d5f6e906700b9d3e718c796"
},
"assertthat": {
"Package": "assertthat",
"Version": "0.2.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"tools"
],
"Hash": "50c838a310445e954bc13f26f26a6ecf"
},
"backports": {
"Package": "backports",
"Version": "1.4.1",
Expand Down Expand Up @@ -337,6 +339,13 @@
],
"Hash": "9fe98599ca456d6552421db0d6772d8f"
},
"bitops": {
"Package": "bitops",
"Version": "1.0-7",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "b7d8d8ee39869c18d8846a184dd8a1af"
},
"boot": {
"Package": "boot",
"Version": "1.3-30",
Expand Down Expand Up @@ -600,18 +609,6 @@
],
"Hash": "8ee9ac56ef633d0c7cab8b2ca87d683e"
},
"debugme": {
"Package": "debugme",
"Version": "1.2.0",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"crayon",
"grDevices"
],
"Hash": "62e5354b9a514d3a2e1d68311956a8f7"
},
"desc": {
"Package": "desc",
"Version": "1.4.3",
Expand All @@ -625,6 +622,29 @@
],
"Hash": "99b79fcbd6c4d1ce087f5c5c758b384f"
},
"dfeshiny": {
"Package": "dfeshiny",
"Version": "0.2.0",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "dfe-analytical-services",
"RemoteRepo": "dfeshiny",
"RemoteRef": "main",
"RemoteSha": "fb0a97efd819c4735c3e57dc3b294a5ad2911ef5",
"Requirements": [
"RCurl",
"checkmate",
"glue",
"htmltools",
"shiny",
"shinyGovstyle",
"shinyjs",
"stringr",
"styler"
],
"Hash": "23cba66872a9f50b6cde614c29286073"
},
"diffobj": {
"Package": "diffobj",
"Version": "0.3.5",
Expand Down Expand Up @@ -1333,13 +1353,6 @@
],
"Hash": "737924139a1e4fc96356ff377c754c35"
},
"parsedate": {
"Package": "parsedate",
"Version": "1.3.1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "7f5024cc7af45eeecef657fa62beb568"
},
"pillar": {
"Package": "pillar",
"Version": "1.9.0",
Expand Down Expand Up @@ -1943,35 +1956,6 @@
],
"Hash": "802e4786b353a4bb27116957558548d5"
},
"shinytest": {
"Package": "shinytest",
"Version": "1.5.4",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R6",
"assertthat",
"callr",
"crayon",
"debugme",
"digest",
"htmlwidgets",
"httpuv",
"httr",
"jsonlite",
"parsedate",
"pingr",
"rematch",
"rlang",
"rstudioapi",
"shiny",
"testthat",
"utils",
"webdriver",
"withr"
],
"Hash": "e67fb55bbc90d2f74fb216477ad0a425"
},
"shinytest2": {
"Package": "shinytest2",
"Version": "0.3.2",
Expand All @@ -1997,17 +1981,6 @@
],
"Hash": "a414c1bb2eb6e2a920742d3ebce84962"
},
"showimage": {
"Package": "showimage",
"Version": "1.0.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"png",
"tools"
],
"Hash": "841927b226db842d24d9c288c99ed27b"
},
"sourcetools": {
"Package": "sourcetools",
"Version": "0.1.7-1",
Expand Down Expand Up @@ -2313,25 +2286,6 @@
],
"Hash": "c7d3fd6d29ab077cbac8f0e2751449e6"
},
"webdriver": {
"Package": "webdriver",
"Version": "1.0.6",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R6",
"base64enc",
"callr",
"curl",
"debugme",
"httr",
"jsonlite",
"showimage",
"utils",
"withr"
],
"Hash": "adc1e0db3ac0d75dcdb4b8179e7ca796"
},
"websocket": {
"Package": "websocket",
"Version": "1.4.1",
Expand Down

0 comments on commit 4404abe

Please sign in to comment.