Skip to content

Commit

Permalink
chore: code linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepanshKhurana committed Feb 21, 2024
1 parent 55dbbdd commit 84442ba
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 40 deletions.
36 changes: 18 additions & 18 deletions app/logic/api_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ get_access_token <- function() {
#' @param versioned Logical. Whether to use versioned API. Default is FALSE
#' @return url for the API
get_api_url <- function(
host = Sys.getenv("CONNECT_SERVER"),
endpoint = "content",
version = "v1"
host = Sys.getenv("CONNECT_SERVER"),
endpoint = "content",
version = "v1"
) {
glue("{host}__api__/{version}/{endpoint}/")
}
Expand All @@ -49,9 +49,9 @@ get_api_url <- function(
#' Default is FALSE
#' @export
get_app_list <- function(
app_mode_filter = "shiny",
endpoint = "content",
dry_run = FALSE
app_mode_filter = "shiny",
endpoint = "content",
dry_run = FALSE
) {

url <- get_api_url(
Expand Down Expand Up @@ -82,9 +82,9 @@ get_app_list <- function(
#' Default is FALSE
#' @export
get_job_list <- function(
guid = NULL,
endpoint = "content",
dry_run = FALSE
guid = NULL,
endpoint = "content",
dry_run = FALSE
) {

url <- get_api_url(
Expand Down Expand Up @@ -118,11 +118,11 @@ get_job_list <- function(
#' Default is FALSE
#' @export
get_job_logs <- function(
guid = NULL,
job_key = NULL,
endpoint = "content",
tail = FALSE,
dry_run = FALSE
guid = NULL,
job_key = NULL,
endpoint = "content",
tail = FALSE,
dry_run = FALSE
) {

url <- get_api_url(
Expand Down Expand Up @@ -157,10 +157,10 @@ get_job_logs <- function(
#' Default is FALSE
#' @export
download_job_logs <- function(
guid = NULL,
job_key = NULL,
endpoint = "content",
dry_run = FALSE
guid = NULL,
job_key = NULL,
endpoint = "content",
dry_run = FALSE
) {

url <- get_api_url(
Expand Down
2 changes: 1 addition & 1 deletion app/logic/app_table_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ box::use(
#'
#' @export
process_app_data <- function(
app_data
app_data
) {
app_info <- strsplit(app_data, "_-_")[[1]]
div(
Expand Down
12 changes: 6 additions & 6 deletions app/logic/general_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#' Default is TRUE
#' @export
check_text_error <- function(
text,
wordlist = c("halt", "err", "terminat", "not found"),
ignore_case = TRUE
text,
wordlist = c("halt", "err", "terminat", "not found"),
ignore_case = TRUE
) {
grepl(
paste(wordlist, collapse = "|"),
Expand All @@ -25,9 +25,9 @@ check_text_error <- function(
#' @param to Character. New format. Default is "%Y-%m-%d %H:%M:%S"
#' @export
format_timestamp <- function(
timestamp,
from = "%Y-%m-%dT%H:%M:%OSZ",
to = "%Y-%m-%d %H:%M:%S"
timestamp,
from = "%Y-%m-%dT%H:%M:%OSZ",
to = "%Y-%m-%d %H:%M:%S"
) {
format(
as.POSIXct(
Expand Down
2 changes: 1 addition & 1 deletion app/logic/job_list_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ box::use(
#'
#' @export
process_job_data <- function(
job_data
job_data
) {
job_info <- strsplit(job_data, "_-_")[[1]]
div(
Expand Down
6 changes: 3 additions & 3 deletions app/logic/logs_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ box::use(
#'
#' @export
process_log_data <- function(
log_data
log_data
) {
log_info <- strsplit(log_data, "_-_")[[1]]
status <- get_status_info(log_info[1], log_info[3])
Expand All @@ -42,8 +42,8 @@ process_log_data <- function(
}

get_status_info <- function(
output_type,
log_data
output_type,
log_data
) {
if (output_type == "stdout") {
c("green", "circle-info")
Expand Down
2 changes: 1 addition & 1 deletion app/static/css/app.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/styles/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
height: 100vh;
}

.Reactable {
.reactable {
background: transparent;
}

.rt-search {
width: 80%;
margin: 10px 10px 20px 10px;
margin: 10px 10px 20px;
align-self: center;
text-align: center;
border-radius: 0;
Expand Down
4 changes: 2 additions & 2 deletions app/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Maven+Pro:wght@400;600&display=swap');
@import "https://fonts.googleapis.com/css2?family=Maven+Pro:wght@400;600&display=swap";
@import "colors";
@import "logs";
@import "dashboard";
Expand All @@ -7,7 +7,7 @@
@import "header";

* {
font-family: Maven Pro, 'sans-serif';
font-family: "Maven Pro", sans-serif;
}

.vertical-line {
Expand Down
6 changes: 0 additions & 6 deletions tests/testthat/test-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ box::use(
box::use(
app/main[...],
)

test_that("main server works", {
testServer(server, {
expect_true(grepl(x = output$message$html, pattern = "Check out Rhino docs!"))
})
})

0 comments on commit 84442ba

Please sign in to comment.