Skip to content

Commit

Permalink
Style code (GHA)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Sep 11, 2024
1 parent cf5bfe2 commit 4862935
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
21 changes: 10 additions & 11 deletions R/app_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ app_sys <- function(...) {
#'
#' @importFrom config get
get_app_config <- function(
value,
config = Sys.getenv(
"APP_CONFIG_ACTIVE",
Sys.getenv(
"R_CONFIG_ACTIVE",
"default"
)
),
use_parent = TRUE,
file = app_sys("config.yml")
) {
value,
config = Sys.getenv(
"APP_CONFIG_ACTIVE",
Sys.getenv(
"R_CONFIG_ACTIVE",
"default"
)
),
use_parent = TRUE,
file = app_sys("config.yml")) {
config::get(
value = value,
config = config,
Expand Down
11 changes: 5 additions & 6 deletions R/app_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
#' @importFrom shiny shinyApp
#' @importFrom golem with_golem_options
run_app <- function(
onStart = NULL,
options = list(),
enableBookmarking = NULL,
uiPattern = "/",
...
) {
onStart = NULL,
options = list(),
enableBookmarking = NULL,
uiPattern = "/",
...) {
with_golem_options(
app = shinyApp(
ui = app_ui,
Expand Down
4 changes: 2 additions & 2 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
app_server <- function(input, output, session) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)

# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
hist(x, breaks = bins, col = "darkgray", border = "white")
})
}
9 changes: 6 additions & 3 deletions tests/spelling.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if(requireNamespace('spelling', quietly = TRUE))
spelling::spell_check_test(vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE)
if (requireNamespace("spelling", quietly = TRUE)) {
spelling::spell_check_test(
vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE
)
}
3 changes: 0 additions & 3 deletions tests/testthat/test-app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ test_that("app server", {
})

testServer(app_server, {

# Set and test an input
session$setInputs(bins = 2)
expect_equal(input$bins, 2)

})

1 change: 0 additions & 1 deletion tests/testthat/test-app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ test_that("app ui", {
expect_true(i %in% names(fmls))
}
})

0 comments on commit 4862935

Please sign in to comment.