From c6ca1f723e12294cfe68b634b02d0914c0c711ae Mon Sep 17 00:00:00 2001 From: "alex.hill@gmail.com" Date: Wed, 28 Aug 2024 15:51:50 +0100 Subject: [PATCH] exluce test files from lintr --- .github/workflows/lint.yaml | 2 +- R/api.R | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 018b8db..0f5260d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -28,7 +28,7 @@ jobs: needs: lint - name: Lint - run: lintr::lint_package() + run: lintr::lint_dir("R") shell: Rscript {0} env: LINTR_ERROR_ON_LINT: true diff --git a/R/api.R b/R/api.R index 7ad6c6f..ba373eb 100644 --- a/R/api.R +++ b/R/api.R @@ -105,7 +105,7 @@ target_get_trace <- function(name, dat <- apply_filter(f, dat, cols) } } - dat <- dat[dat["biomarker"] == biomarker,] + dat <- dat[dat["biomarker"] == biomarker, ] if (length(disaggregate) > 0) { logger::log_info(paste("Disaggregating by variables:", disaggregate)) groups <- split(dat, eval(parse(text = paste("~", disaggregate)))) @@ -173,7 +173,7 @@ apply_filter <- function(filter, dat, cols) { "not found in data"), code = "BAD_REQUEST", status_code = 400L) } - dat[dat[filter_var] == filter_level,] + dat[dat[filter_var] == filter_level, ] } bad_request_response <- function(msg) { @@ -191,5 +191,5 @@ get_or_create_session_id <- function(req) { } generate_session_id <- function() { - rawToChar(as.raw(sample(c(65:90,97:122), 10, replace=T))) + rawToChar(as.raw(sample(c(65:90, 97:122), 10, replace=T))) }