Skip to content

Commit 2b28956

Browse files
committed
Add #nocov tags to R/* files
1 parent dabc522 commit 2b28956

File tree

8 files changed

+33
-27
lines changed

8 files changed

+33
-27
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2026-01-01 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/Attributes.R: Additional #nocov tags for new(er) code
4+
* R/Rcpp.package.skeleton.R: Idem
5+
* R/RcppLdpath.R: Idem
6+
* R/asis.R: Idem
7+
* R/inline.R: Idem
8+
19
2025-12-30 Dirk Eddelbuettel <[email protected]>
210

311
* tests/tinytest.R: Refine decision of when not to run all tests even

R/Attributes.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# Copyright (C) 2012 - 2022 JJ Allaire, Dirk Eddelbuettel and Romain Francois
3-
# Copyright (C) 2023 - 2024 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
3+
# Copyright (C) 2023 - 2026 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
44
#
55
# This file is part of Rcpp.
66
#
@@ -571,7 +571,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
571571
}
572572

573573
.openmpPluginDefault <- function() {
574-
list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp"))
574+
list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp")) # #nocov start
575575
}
576576

577577
.openmpPluginDarwin <- function() {
@@ -629,7 +629,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
629629
libs <- "-fopenmp"
630630
}
631631

632-
list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs))
632+
list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs)) # #nocov end
633633

634634
}
635635

R/Module.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#

R/Rcpp.package.skeleton.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -93,7 +93,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
9393
email))
9494
fields_written <- c("Package", "Type", "Title", "Version", "Date",
9595
"Authors@R", "Description", "License", "Imports", "LinkingTo")
96-
if (!is.na(githubuser)) {
96+
if (!is.na(githubuser)) { # #nocov start
9797
x <- cbind(x, matrix("", 1, 1, dimnames=list("", "URL")))
9898
x[1, "URL"] <- paste0("https://github.com/", githubuser, "/", name)
9999
x <- cbind(x, matrix("", 1, 1, dimnames=list("", "BugReports")))
@@ -102,7 +102,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
102102
fields_written <- c("Package", "Type", "Title", "Version", "Date",
103103
"Authors@R", "Description", "URL", "BugReports",
104104
"License", "Imports", "LinkingTo")
105-
}
105+
} # #nocov end
106106

107107
x[, "License"] <- license
108108
x[, "Title"] <- "Concise Summary of What the Package Does"
@@ -136,7 +136,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
136136

137137
## update the package description help page
138138
if (havePkgKitten) { # if pkgKitten is available, use it
139-
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email)
139+
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov
140140
} else {
141141
.playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov
142142
}

R/RcppLdpath.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2021 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -25,7 +25,7 @@ Rcpp.quoteNonStandard <- function(path) {
2525
## On unix, check if path has only characters that do not need quoting
2626
noquote <- .Platform$OS.type == "unix" && grepl("^[[:alnum:]/._~+@%-]*$", path)
2727
## If no quoting needed return unchanged else quote input
28-
if (noquote) path else shQuote(path)
28+
if (noquote) path else shQuote(path) # #nocov
2929
}
3030

3131
## Use R's internal knowledge of path settings to find the lib/ directory
@@ -66,11 +66,11 @@ RcppCxxFlags <- function(cxx0x=FALSE) {
6666

6767
## Shorter names, and call cat() directly
6868
## CxxFlags defaults to no using c++0x extensions are these are considered non-portable
69-
CxxFlags <- function(cxx0x=FALSE) {
69+
CxxFlags <- function(cxx0x=FALSE) { # #nocov start
7070
#.Deprecated(msg=paste("This function is now deprecated as R uses minimally",
7171
# "viable compilers om all platforme."))
7272
message("'CxxFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.")
73-
cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov
73+
cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov end
7474
}
7575

7676
## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X
@@ -84,11 +84,11 @@ RcppCapabilities <- capabilities <- function() .Call( rcpp_capabilities )
8484

8585
# compile, load and call the cxx0x.c script to identify whether
8686
# the compiler is GCC >= 4.3
87-
RcppCxx0xFlags <- function() {
87+
RcppCxx0xFlags <- function() { # #nocov start
8888
#.Deprecated(msg=paste("This function is now deprecated as R uses minimally",
8989
# "viable compilers om all platforme."))
9090
message("'RcppCxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.")
91-
script <- Rcpp.system.file( "discovery", "cxx0x.R" ) # #nocov start
91+
script <- Rcpp.system.file( "discovery", "cxx0x.R" )
9292
flag <- capture.output( source( script ) )
9393
flag
9494
}

R/asis.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
##' # %\VignettePackage{Rcpp}
3131
##' # %\VignetteEncoding{UTF-8}
3232
##' # %\VignetteEngine{Rcpp::asis}
33-
asisWeave <- function (file, ...) {
33+
asisWeave <- function (file, ...) { # #nocov start
3434
output <- tools::file_path_sans_ext(basename(file))
3535
if (!file.exists(output)) {
3636
outputS <- file.path("..", "inst", "doc", output)
@@ -53,4 +53,4 @@ asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") {
5353
filenameR <- sprintf("%s.R", fullname)
5454
cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR)
5555
invisible(filenameR)
56-
}
56+
} # #nocov end

R/inline.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -24,7 +24,7 @@ Rcpp.plugin.maker <- function(include.before = "",
2424
Makevars = NULL ,
2525
Makevars.win = NULL,
2626
package = "Rcpp") {
27-
function(...) {
27+
function(...) { # #nocov
2828
includes <- sprintf("%s
2929
#include <Rcpp.h>
3030
%s
@@ -43,7 +43,7 @@ using namespace Rcpp;", include.before, include.after)
4343
includes = includes,
4444
LinkingTo = LinkingTo ,
4545
body = function( x ) {
46-
sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x )
46+
sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) # #nocov
4747
},
4848
Depends = Depends,
4949
Imports = Imports)
@@ -54,4 +54,3 @@ using namespace Rcpp;", include.before, include.after)
5454
}
5555

5656
inlineCxxPlugin <- Rcpp.plugin.maker()
57-

R/loadModule.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2015 John Chambers, Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -54,12 +54,12 @@ loadModule <- function( module, what = character(), loadNow,
5454
if(exists(metaName, envir = env, inherits = FALSE))
5555
loadM <- get(metaName, envir = env)
5656
}
57-
else if(is(module, "Module")) {
58-
loadM <- as.environment(module) # #nocov
59-
module <- get(loadM, "moduleName") # #nocov
57+
else if(is(module, "Module")) { # #nocov start
58+
loadM <- as.environment(module)
59+
module <- get(loadM, "moduleName")
6060
}
6161
else
62-
stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module)))
62+
stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) # #nocov end
6363
if(missing(loadNow)) { # test it
6464
if(is.null(loadM))
6565
loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ),
@@ -104,7 +104,7 @@ loadModule <- function( module, what = character(), loadNow,
104104
assignAs <- .moduleNames(what)
105105
for( i in seq_along(what) ) {
106106
if(.botched)
107-
assign(assignAs[[i]], NULL, envir = storage)
107+
assign(assignAs[[i]], NULL, envir = storage) # #nocov
108108
else
109109
assign(assignAs[[i]], get(what[[i]], envir = storage), envir = env)
110110
}
@@ -120,4 +120,3 @@ loadModule <- function( module, what = character(), loadNow,
120120
invisible(myCall) # #nocov
121121
}
122122
}
123-

0 commit comments

Comments
 (0)