Skip to content

Commit e5f1e77

Browse files
author
hornik
committed
Tweaks for checking internal Rd files.
git-svn-id: https://svn.r-project.org/R/trunk@88320 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent b30b5a3 commit e5f1e77

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

src/library/tools/R/QC.R

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,10 @@ function(package, dir, lib.loc = NULL, chkInternal = NULL)
14081408
db_argument_names <- lapply(db, .Rd_get_argument_names)
14091409

14101410
bad_doc_objects <- list()
1411-
all_special <- (length(bad_lines) == 0L)
1411+
all_internal <- (length(bad_lines) == 0L)
1412+
1413+
if(missing(package))
1414+
package <- .get_package_metadata(dir)["Package"]
14121415

14131416
for(nm in names(db)) {
14141417
## <FIXME>
@@ -1426,7 +1429,13 @@ function(package, dir, lib.loc = NULL, chkInternal = NULL)
14261429
## ignore arguments in \usage but not in \arguments.
14271430
internal <- "internal" %in% db_keywords[[nm]]
14281431
if(internal && !chkInternal) next
1429-
special <- (internal && check_internal_specially)
1432+
special <-
1433+
(internal &&
1434+
(check_internal_specially ||
1435+
(package == "base") ||
1436+
nm %in% paste0(package,
1437+
c("-defunct", "-deprecated", "-internal"),
1438+
".Rd")))
14301439

14311440
aliases <- db_aliases[[nm]]
14321441
arg_names_in_arg_list <- db_argument_names[[nm]]
@@ -1553,14 +1562,14 @@ function(package, dir, lib.loc = NULL, chkInternal = NULL)
15531562
overdoc = arg_names_in_arg_list_missing_in_usage,
15541563
unaliased = functions_not_in_aliases,
15551564
assignments = assignments)
1556-
if(!special)
1557-
all_special <- FALSE
1565+
if(!internal)
1566+
all_internal <- FALSE
15581567
}
15591568
} # for(..)
15601569

15611570
structure(bad_doc_objects, class = "checkDocFiles",
15621571
"bad_lines" = bad_lines,
1563-
"all_special" = all_special)
1572+
"all_internal" = all_internal)
15641573
}
15651574

15661575
format.checkDocFiles <-
@@ -1615,14 +1624,14 @@ function(x, ...)
16151624

16161625
## <NOTE>
16171626
## Terrible hack, see comments on
1618-
## __R_CHECK_DOC_FILES_NOTE_IF_ALL_SPECIAL__
1627+
## __R_CHECK_DOC_FILES_NOTE_IF_ALL_INTERNAL__
16191628
## in check.R
16201629
if(length(y) &&
16211630
!length(bad_lines) &&
1622-
(Sys.getenv("__R_CHECK_DOC_FILES_NOTE_IF_ALL_SPECIAL__",
1631+
(Sys.getenv("__R_CHECK_DOC_FILES_NOTE_IF_ALL_INTERNAL__",
16231632
"FALSE") == "TRUE") &&
1624-
isTRUE(attr(x, "all_special")))
1625-
y <- c(y, "All issues in internal Rd files checked specially.")
1633+
isTRUE(attr(x, "all_internal")))
1634+
y <- c(y, "All issues in internal Rd files.")
16261635
## </NOTE>
16271636

16281637
y

src/library/tools/R/check.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,7 +2748,7 @@ add_dummies <- function(dir, Log)
27482748
## checked specially and only give a NOTE in this case.
27492749
## Ideally, we would use R() to get the check object and be
27502750
## able to compute on it, but that is not so simple ...
2751-
Sys.setenv("__R_CHECK_DOC_FILES_NOTE_IF_ALL_SPECIAL__" =
2751+
Sys.setenv("__R_CHECK_DOC_FILES_NOTE_IF_ALL_INTERNAL__" =
27522752
"TRUE")
27532753
Rcmd <- paste(opWarn_string, "\n",
27542754
sprintf("tools::checkDocFiles(%s, chkInternal=%s)\n",
@@ -2758,8 +2758,7 @@ add_dummies <- function(dir, Log)
27582758
out <- R_runR2(Rcmd)
27592759
if (length(out)) {
27602760
any <- TRUE
2761-
pos <- which(out ==
2762-
"All issues in internal Rd files checked specially.")
2761+
pos <- which(out == "All issues in internal Rd files.")
27632762
if(length(pos)) {
27642763
noteLog(Log)
27652764
out <- out[-pos]

0 commit comments

Comments
 (0)