diff --git a/DESCRIPTION b/DESCRIPTION index 1ceb65a5e..423b95549 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: teal.data Title: Data Model for 'teal' Applications -Version: 0.3.0.9032 -Date: 2024-01-05 +Version: 0.3.0.9033 +Date: 2024-01-11 Authors@R: c( person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre")), person("Pawel", "Rucki", , "pawel.rucki@roche.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 6352a24d4..fc1f8b936 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal.data 0.3.0.9032 +# teal.data 0.3.0.9033 ### Enhancements diff --git a/R/utils.R b/R/utils.R deleted file mode 100644 index efcc9e415..000000000 --- a/R/utils.R +++ /dev/null @@ -1,31 +0,0 @@ -#' Whether the variable name is good to use within Show R Code -#' -#' Spaces are problematic because the variables must be escaped -#' with backticks. -#' Also, they should not start with a number as R may silently make -#' it valid by changing it. -#' Therefore, we only allow alphanumeric characters with underscores. -#' The first character of the `name` must be an alphabetic character -#' and can be followed by alphanumeric characters. -#' -#' @md -#' -#' @param name `character, single or vector` name to check -#' @keywords internal -check_simple_name <- function(name) { - checkmate::assert_character(name, min.len = 1, any.missing = FALSE) - if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) { - checkmate::makeAssertion( - name, - paste0( - "'", - name, - "' ", - "must only contain alphanumeric characters (with underscores)", - " and the first character must be an alphabetic character" - ), - var.name = "name", - NULL - ) - } -} diff --git a/man/check_simple_name.Rd b/man/check_simple_name.Rd deleted file mode 100644 index 72310bdc5..000000000 --- a/man/check_simple_name.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{check_simple_name} -\alias{check_simple_name} -\title{Whether the variable name is good to use within Show R Code} -\usage{ -check_simple_name(name) -} -\arguments{ -\item{name}{\verb{character, single or vector} name to check} -} -\description{ -Spaces are problematic because the variables must be escaped -with backticks. -Also, they should not start with a number as R may silently make -it valid by changing it. -Therefore, we only allow alphanumeric characters with underscores. -The first character of the \code{name} must be an alphabetic character -and can be followed by alphanumeric characters. -} -\keyword{internal} diff --git a/tests/testthat/test-check_simple_name.R b/tests/testthat/test-check_simple_name.R deleted file mode 100644 index 693c37139..000000000 --- a/tests/testthat/test-check_simple_name.R +++ /dev/null @@ -1,19 +0,0 @@ -test_that("check_simple_name behaves as expected", { - expect_silent(check_simple_name("aas2df")) - expect_silent(check_simple_name("ADSL")) - expect_silent(check_simple_name("ADSLmodified")) - expect_silent(check_simple_name("a1")) - expect_silent(check_simple_name("ADSL_modified")) - expect_silent(check_simple_name("ADSL_filtered")) - expect_silent(check_simple_name("FILTERED_ADSL")) - expect_silent(check_simple_name("FILTERED")) - expect_silent(check_simple_name("ADSLFILTERED")) - expect_silent(check_simple_name("a_1_2_b_")) - expect_silent(check_simple_name("ADSL_FILTERED")) - - expect_error(check_simple_name("1a")) - expect_error(check_simple_name("ADSL.modified")) - expect_error(check_simple_name("a1...")) - expect_error(check_simple_name("a a")) - expect_error(check_simple_name("_A_b")) -})