From aa04f90fc310fb7d41333f6f5f5cf05a0644ff1b Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 29 Sep 2024 15:13:23 -0700 Subject: [PATCH 1/3] Always set _R_CHECK_TESTS_NLINES_=0 (#6549) --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c060b618a..e0cdc2ecf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ variables: _R_CHECK_FORCE_SUGGESTS_: "false" _R_CHECK_NO_STOP_ON_TEST_ERROR_: "true" _R_CHECK_SYSTEM_CLOCK_: "false" ## https://stackoverflow.com/questions/63613301/r-cmd-check-note-unable-to-verify-current-time + _R_CHECK_TESTS_NLINES_: "0" TZ: "UTC" ## to avoid 'Failed to create bus connection' from timedatectl via Sys.timezone() on Docker with R 3.4. ## Setting TZ for all GLCI jobs to isolate them from timezone. We could have a new GLCI job to test under ## a non-UTC timezone, although, that's what we do routinely in dev. @@ -114,7 +115,6 @@ test-lin-rel: _R_CHECK_CRAN_INCOMING_: "FALSE" _R_CHECK_CRAN_INCOMING_REMOTE_: "FALSE" _R_CHECK_FORCE_SUGGESTS_: "TRUE" - _R_CHECK_TESTS_NLINES_: "0" OPENBLAS_MAIN_FREE: "1" script: - *install-deps From 7419796d6deb0fba545e734e0ecabd2f898ab76f Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 29 Sep 2024 23:03:14 -0700 Subject: [PATCH 2/3] Run more GHA on pull requests targeting any branch (#6553) * Run coverage on pull requests targeting any branch * Consistency in other checks too --- .github/workflows/code-quality.yaml | 5 +---- .github/workflows/performance-tests.yml | 2 -- .github/workflows/rchk.yaml | 3 +-- .github/workflows/test-coverage.yaml | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml index ca4225458..19ee0c327 100644 --- a/.github/workflows/code-quality.yaml +++ b/.github/workflows/code-quality.yaml @@ -1,10 +1,7 @@ on: push: - branches: - - master + branches: [master] pull_request: - branches: - - master name: code-quality diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml index e1b9a5409..3d81f5741 100644 --- a/.github/workflows/performance-tests.yml +++ b/.github/workflows/performance-tests.yml @@ -2,8 +2,6 @@ name: atime performance tests on: pull_request: - branches: - - '*' types: - opened - reopened diff --git a/.github/workflows/rchk.yaml b/.github/workflows/rchk.yaml index c799df028..96b982ca8 100644 --- a/.github/workflows/rchk.yaml +++ b/.github/workflows/rchk.yaml @@ -17,8 +17,7 @@ # under the License. on: push: - branches: - - master + branches: [master] pull_request: name: 'rchk' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 79fcd6fdc..c46e655a5 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -4,7 +4,6 @@ on: push: branches: [master] pull_request: - branches: [master] name: test-coverage.yaml From d62aac9e719d341b8d60089c772d87a93eabb5d8 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 1 Oct 2024 10:24:14 -0700 Subject: [PATCH 3/3] Early returns to reduce nesting and improve readability (#6542) --- R/programming.R | 6 +++--- src/programming.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/R/programming.R b/R/programming.R index c82fb3681..e12ddbc3a 100644 --- a/R/programming.R +++ b/R/programming.R @@ -14,8 +14,8 @@ list2lang = function(x) { stopf("'x' must be a list") if (is.AsIs(x)) return(rm.AsIs(x)) - asis = vapply(x, is.AsIs, FALSE) - char = vapply(x, is.character, FALSE) + asis = vapply_1b(x, is.AsIs) + char = vapply_1b(x, is.character) to.name = !asis & char if (any(to.name)) { ## turns "my_name" character scalar into `my_name` symbol, for convenience if (any(non.scalar.char <- lengths(x[to.name])!=1L)) { @@ -24,7 +24,7 @@ list2lang = function(x) { x[to.name] = lapply(x[to.name], as.name) } if (isTRUE(getOption("datatable.enlist", TRUE))) { ## recursively enlist for nested lists, see note section in substitute2 manual - islt = vapply(x, only.list, FALSE) #5057 nested DT that inherits from a list must not be turned into list call + islt = vapply_1b(x, only.list) #5057 nested DT that inherits from a list must not be turned into list call to.enlist = !asis & islt if (any(to.enlist)) { x[to.enlist] = lapply(x[to.enlist], enlist) diff --git a/src/programming.c b/src/programming.c index bc059230f..2d6b18586 100644 --- a/src/programming.c +++ b/src/programming.c @@ -1,29 +1,29 @@ #include "data.table.h" static void substitute_call_arg_names(SEXP expr, SEXP env) { - R_len_t len = length(expr); - if (len && isLanguage(expr)) { // isLanguage is R's is.call - SEXP arg_names = getAttrib(expr, R_NamesSymbol); - if (!isNull(arg_names)) { - SEXP env_names = getAttrib(env, R_NamesSymbol); - int *imatches = INTEGER(PROTECT(chmatch(arg_names, env_names, 0))); - const SEXP *env_sub = SEXPPTR_RO(env); - SEXP tmp = expr; - for (int i=0; i