Skip to content

Commit

Permalink
add #nocov and #nolint exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Nov 4, 2023
1 parent 372029a commit 79147ec
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
2 changes: 2 additions & 0 deletions R/ccn_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#'
#' @autoglobal
#' @noRd
# nocov start
ccn_decode <- function(x) {

if (nchar(x) %in% !c(6, 10)) {type <- "Unknown Type"}
Expand Down Expand Up @@ -292,3 +293,4 @@ ccn_state_codes <- function(x) {
.default = x)

}
# nocov end
2 changes: 2 additions & 0 deletions R/ms_drg.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#' download_msdrg()
#' @autoglobal
#' @noRd
# nocov start
download_msdrg <- function() {

url <- "https://www.hipaaspace.com/medical.coding.library/drgs/"
Expand All @@ -49,3 +50,4 @@ download_msdrg <- function() {
drg_abbrev = dplyr::na_if(drg_abbrev, ""))

}
# nocov end
2 changes: 2 additions & 0 deletions R/outpatient.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#'
#' @autoglobal
#' @export
# nocov start
outpatient <- function(year,
ccn = NULL,
organization = NULL,
Expand Down Expand Up @@ -130,3 +131,4 @@ cols_out <- function(df) {

df |> dplyr::select(dplyr::any_of(cols))
}
# nocov end
10 changes: 5 additions & 5 deletions R/utilization.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ utilization <- function(year,
type <- rlang::arg_match(type, c("provider", "service", "geography"))

if (type != "provider") c(nest, detailed) %<-% c(FALSE, FALSE)
if (type == "provider") c(rbcs, hcpcs = NULL, pos = NULL, drug = NULL) %<-% c(FALSE)
if (type == "provider") c(rbcs, hcpcs = NULL, pos = NULL, drug = NULL) %<-% c(FALSE) # nolint
if (type != "geography") level <- NULL

if (type == "geography") {
Expand All @@ -153,15 +153,15 @@ utilization <- function(year,
ruca <- NULL
country <- NULL
specialty <- NULL
par <- NULL
par <- NULL # nolint
if (!is.null(state) && (state %in% state.abb)) state <- abb2full(state)
}

npi <- npi %nn% validate_npi(npi)
zip <- zip %nn% as.character(zip)
fips <- fips %nn% as.character(fips)
ruca <- ruca %nn% as.character(ruca)
par <- par %nn% tf_2_yn(par)
par <- par %nn% tf_2_yn(par) # nolint
hcpcs <- hcpcs %nn% as.character(hcpcs)
drug <- drug %nn% tf_2_yn(drug)

Expand All @@ -186,7 +186,7 @@ utilization <- function(year,
"Rndrng_Prvdr_RUCA", ruca,
"Rndrng_Prvdr_Cntry", country,
"Rndrng_Prvdr_Type", specialty,
"Rndrng_Prvdr_Mdcr_Prtcptg_Ind", par,
"Rndrng_Prvdr_Mdcr_Prtcptg_Ind", par, # nolint
"HCPCS_Cd", hcpcs,
"HCPCS_Drug_Ind", drug,
"Place_Of_Srvc", pos,
Expand Down Expand Up @@ -226,7 +226,7 @@ utilization <- function(year,
"ruca", ruca,
"country", country,
"specialty", specialty,
"par", par,
"par", par, # nolint
"hcpcs", hcpcs,
"drug", drug,
"pos", pos) |>
Expand Down
6 changes: 2 additions & 4 deletions R/utils-gt.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ gt_datadict <- function(df) {
gt::gt() |>
gt::fmt_markdown(columns = Variable) |>
gtExtras::gt_add_divider(
columns = c("Variable"),
columns = c("Variable"), # nolint
style = "solid",
color = "gray",
weight = gt::px(2),
Expand Down Expand Up @@ -180,9 +180,7 @@ gt_prov <- function(df,
results <- results |> gt::tab_header(title = title, subtitle = subtitle)
}

if (!is.null(source)) {
results <- results |> gt::tab_source_note(source_note = source)
}
if (!is.null(source)) results <- gt::tab_source_note(results, source_note = source) # nolint

if (!is.null(checkmark)) {
results <- results |> gt_check_xmark(cols = checkmark)
Expand Down
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ abb2full <- function(abb,
dplyr::pull(y)

if (vctrs::vec_is_empty(results)) {
cli::cli_abort(c("{.val {abb}} is not a valid state abbreviation."),
cli::cli_abort(c("{.val {abb}} is not a valid state abbreviation."), # nolint
call = call)
}
return(results)
Expand Down Expand Up @@ -165,7 +165,7 @@ df2chr <- function(df) {
#' @export
#' @keywords internal
tidyup <- function(df,
dt = c("date"),
dt = "date",
yn = NULL,
int = NULL,
dbl = NULL,
Expand Down Expand Up @@ -363,7 +363,7 @@ build_url <- function(fn, args = NULL) {
"tax" ~ "Medicare Provider and Supplier Taxonomy Crosswalk",
"bet" ~ "Restructured BETOS Classification System")

if (fn %in% c("tax") && is.null(args)) {
if (fn %in% c("tax") && is.null(args)) { # nolint

url <- paste0("https://data.cms.gov/data-api/v1/dataset/",
cms_update(api)$distro[1],
Expand Down
2 changes: 1 addition & 1 deletion man/tidyup.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files

library(testthat)
library(httptest2)
library(testthat) # nolint
library(httptest2) # nolint
test_check("provider")

0 comments on commit 79147ec

Please sign in to comment.