diff --git a/DESCRIPTION b/DESCRIPTION index 84a042a..73a77a2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tinyrox Title: Minimal R Documentation Generator -Version: 0.3.3.5 +Version: 0.3.3.6 Authors@R: person("Troy", "Hernandez", email = "troy@cornball.ai", role = c("aut", "cre"), comment = c(ORCID = "0009-0005-4248-604X")) diff --git a/NAMESPACE b/NAMESPACE index ddd1ede..47b05f6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,9 +2,7 @@ export(check_code_cran) export(check_cran) -export(check_description_cran) export(check_examples_cran) export(clean) export(document) -export(fix_description_cran) export(parse_tags) diff --git a/NEWS.md b/NEWS.md index e279637..c9a996a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# tinyrox 0.3.3.6 + +* Accept `@returns` as a plural alias of `@return` (#24). roxygen2 supports both spellings, so an unlisted `@returns` no longer aborts `document()`. +* Unknown tags now warn and are skipped instead of aborting the run (roxygen2's behavior). One unlisted or misspelled tag no longer takes down `document()` for the whole package; the offending tag is named in the warning and its content is dropped, while every other tag still parses. +* Remove DESCRIPTION-field linting (#23). The Title/Description unquoted-name check (`check_description_cran()`, `fix_description_cran()`) and the web-service-link check are gone. A documentation generator should not lint DESCRIPTION prose; the checks leaned on hardcoded, opinionated name lists with no roxygen2 or `R CMD check` equivalent, and one of them flagged (and `fix = TRUE` would rewrite) the ordinary word "graphics" in "base R graphics system". The token-based code checker and example checks (`check_cran()`, `check_examples_cran()`) remain. + # tinyrox 0.3.3.5 * The CRAN code checker scans parse tokens (`utils::getParseData()`) instead of raw source lines (#20). Comments and string literals can no longer trigger findings, `torch.cat()` is no longer `cat()`, `print()`/`cat()` are allowed inside `print.*`/`format.*` S3 methods, and a local variable named `T` or `F` is no longer mistaken for the logical shorthand. `setwd()`/`on.exit()` pairing and `set.seed()` literals are judged within the enclosing function instead of a fixed line window. Unparseable files report one finding instead of erroring. diff --git a/R/check_code.R b/R/check_code.R index b1b08eb..6a89a9d 100644 --- a/R/check_code.R +++ b/R/check_code.R @@ -304,4 +304,3 @@ call_expr_text <- function(pd, id, parents) { text <- tryCatch(utils::getParseText(pd, call_expr), error = function(e) "") paste(text, collapse = "\n") } - diff --git a/R/cran.R b/R/cran.R index db3d7bf..7201fe6 100644 --- a/R/cran.R +++ b/R/cran.R @@ -1,357 +1,12 @@ -# CRAN Compliance Checking for DESCRIPTION +# CRAN Compliance Checking # -# Functions to validate and fix common CRAN submission issues -# related to the DESCRIPTION file. - -# Known web services and their URLs -# Packages that typically require web service documentation -WEBSERVICE_PACKAGES <- list( - - hfhub = "https://huggingface.co/", - huggingface = "https://huggingface.co/", - openai = "https://platform.openai.com/", - gh = "https://github.com/", - googledrive = "https://drive.google.com/", - googlesheets4 = "https://docs.google.com/spreadsheets/", - aws.s3 = "https://aws.amazon.com/s3/", - bigrquery = "https://cloud.google.com/bigquery/" -) - -# Common software/API names that should be quoted (case-insensitive matching) -# These are checked in addition to package names from Imports/Suggests -KNOWN_SOFTWARE_NAMES <- c("OpenAI", "Whisper", "GPT", "ChatGPT", - "TensorFlow", "PyTorch", "Keras", "CUDA", - "HuggingFace", "Hugging Face", "GitHub", "GitLab", - "Bitbucket", "Docker", "Kubernetes", "JAGS", - "Stan", "BUGS", "WinBUGS", "OpenBUGS", "Rcpp", - "RcppArmadillo", "RcppEigen", "Shiny", "Plumber", - "JSON", "XML", "YAML", "CSV", "Excel", "SQLite", - "PostgreSQL", "MySQL", "MongoDB", "AWS", "Azure", - "GCP") - -#' Check DESCRIPTION for CRAN Compliance -#' -#' Validates Title and Description fields for common CRAN issues: -#' unquoted package names, missing web service links, etc. -#' -#' @param path Path to package root directory -#' @param fix If TRUE, return fixed text. If FALSE, just warn. -#' @return List with validation results and optionally fixed text -#' -#' @export -#' @examples -#' \donttest{ -#' # Create a minimal package in tempdir -#' pkg <- file.path(tempdir(), "mypkg") -#' dir.create(pkg, recursive = TRUE, showWarnings = FALSE) -#' writeLines("Package: mypkg\nTitle: Test\nVersion: 0.1.0\nDescription: A test package.", -#' file.path(pkg, "DESCRIPTION")) -#' -#' check_description_cran(pkg) -#' -#' # Clean up -#' unlink(pkg, recursive = TRUE) -#' } -check_description_cran <- function(path = ".", fix = FALSE) { - desc_file <- file.path(path, "DESCRIPTION") - if (!file.exists(desc_file)) { - stop("No DESCRIPTION file found in ", path, call. = FALSE) - } - - desc <- read.dcf(desc_file) - - # Get fields - - if ("Title" %in% colnames(desc)) { - title <- desc[1, "Title"] - } else { - title <- "" - } - if ("Description" %in% colnames(desc)) { - description <- desc[1, "Description"] - } else { - description <- "" - } - - # Get package dependencies - dep_packages <- get_dependency_packages(desc) - - # Build list of names to check (packages + known software) - check_names <- unique(c(dep_packages, KNOWN_SOFTWARE_NAMES)) - - issues <- list() - - # Check for unquoted package/software names - title_unquoted <- find_unquoted_names(title, check_names) - desc_unquoted <- find_unquoted_names(description, check_names) - - if (length(title_unquoted) > 0) { - issues$title_unquoted <- title_unquoted - warning("CRAN: Unquoted names in Title: ", - paste(title_unquoted, collapse = ", "), - "\n Use single quotes: ", - paste0("'", title_unquoted, "'", collapse = ", "), - call. = FALSE) - } - - if (length(desc_unquoted) > 0) { - issues$desc_unquoted <- desc_unquoted - warning("CRAN: Unquoted names in Description: ", - paste(desc_unquoted, collapse = ", "), - "\n Use single quotes: ", - paste0("'", desc_unquoted, "'", collapse = ", "), - call. = FALSE) - } - - # Check for missing web service links - missing_links <- check_webservice_links(description, dep_packages) - if (length(missing_links) > 0) { - issues$missing_links <- missing_links - link_suggestions <- vapply(names(missing_links), function(pkg) { - paste0(pkg, " <", missing_links[[pkg]], ">") - }, character(1)) - warning("CRAN: Missing web service links in Description for: ", - paste(names(missing_links), collapse = ", "), - "\n Consider adding: ", paste(link_suggestions, collapse = ", "), - call. = FALSE) - } - - result <- list(issues = issues, has_issues = length(issues) > 0) - - if (fix) { - result$fixed_title <- quote_names_in_text(title, check_names) - result$fixed_description <- quote_names_in_text(description, check_names) - } - - invisible(result) -} - -#' Extract Package Names from Dependencies -#' -#' Parses Imports, Suggests, Depends, and Enhances fields. -#' -#' @param desc DESCRIPTION matrix from read.dcf() -#' @return Character vector of package names -get_dependency_packages <- function(desc) { - dep_fields <- c("Imports", "Suggests", "Depends", "Enhances", "LinkingTo") - packages <- character() - - for (field in dep_fields) { - if (field %in% colnames(desc) && !is.na(desc[1, field])) { - field_val <- desc[1, field] - # Split on comma, handle newlines - pkgs <- strsplit(field_val, ",")[[1]] - # Remove version specs like (>= 1.0.0) and trim whitespace - pkgs <- gsub("\\s*\\([^)]*\\)", "", pkgs) - pkgs <- trimws(pkgs) - # Remove empty strings and R itself - pkgs <- pkgs[pkgs != "" & pkgs != "R"] - packages <- c(packages, pkgs) - } - } - - unique(packages) -} - -#' Find Unquoted Names in Text -#' -#' Finds package/software names that appear without single quotes. -#' -#' @param text Text to search -#' @param names Names to look for -#' @return Character vector of unquoted names found -find_unquoted_names <- function(text, names) { - if (is.na(text) || text == "") { - return(character()) - } - - unquoted <- character() - - for (name in names) { - # Skip very short names to avoid false positives - if (nchar(name) < 2) { - next - } - - # Pattern: name NOT preceded by ' and NOT followed by ' - # Use word boundaries to avoid partial matches - # But be careful with names containing special regex chars - - escaped_name <- escape_regex(name) - - # Check if name appears unquoted - # Unquoted = appears but not as 'name' - pattern_quoted <- paste0("'", escaped_name, "'") - pattern_unquoted <- paste0("\\b", escaped_name, "\\b") - - # Find all occurrences - if (grepl(pattern_unquoted, text, ignore.case = FALSE)) { - # Check if ALL occurrences are quoted - # Remove quoted versions and see if any remain - text_without_quoted <- gsub(pattern_quoted, "", text) - if (grepl(pattern_unquoted, text_without_quoted, - ignore.case = FALSE)) { - unquoted <- c(unquoted, name) - } - } - } - - unique(unquoted) -} - -#' Quote Names in Text -#' -#' Wraps unquoted package/software names in single quotes. -#' -#' @param text Text to modify -#' @param names Names to quote -#' @return Modified text with names quoted -quote_names_in_text <- function(text, names) { - if (is.na(text) || text == "") { - return(text) - } - - for (name in names) { - if (nchar(name) < 2) { - next - } - - escaped_name <- escape_regex(name) - pattern_quoted <- paste0("'", escaped_name, "'") - - # Only replace unquoted instances - # First, temporarily replace quoted instances - placeholder <- paste0("\001QUOTED_", which(names == name), "\001") - text <- gsub(pattern_quoted, placeholder, text) - - # Now quote unquoted instances (word boundary match) - pattern_unquoted <- paste0("\\b(", escaped_name, ")\\b") - text <- gsub(pattern_unquoted, "'\\1'", text) - - # Restore originally quoted instances - text <- gsub(placeholder, pattern_quoted, text, fixed = TRUE) - } - - text -} - -#' Check for Missing Web Service Links -#' -#' Checks if packages that typically use web services have -#' corresponding URLs in the Description. -#' -#' @param description Description text -#' @param packages Package names from dependencies -#' @return Named list of packages missing links (name = URL) -check_webservice_links <- function(description, packages) { - missing <- list() - - for (pkg in packages) { - pkg_lower <- tolower(pkg) - if (pkg_lower %in% names(WEBSERVICE_PACKAGES)) { - expected_url <- WEBSERVICE_PACKAGES[[pkg_lower]] - # Check if URL (or domain) appears in description - domain <- gsub("https?://([^/]+).*", "\\1", expected_url) - if (!grepl(domain, description, ignore.case = TRUE)) { - missing[[pkg]] <- expected_url - } - } - } - - missing -} - -#' Escape Regex Special Characters -#' -#' @param x String to escape -#' @return Escaped string safe for use in regex -escape_regex <- function(x) { - # Escape special regex metacharacters - # Order matters: escape backslash first - chars <- c("\\", ".", "|", "(", ")", "[", "]", "{", "}", "^", - "$", "+", "*", "?") - for (ch in chars) { - x <- gsub(ch, paste0("\\", ch), x, fixed = TRUE) - } - x -} - -#' Fix DESCRIPTION File -#' -#' Automatically fixes common CRAN issues in DESCRIPTION. -#' -#' @param path Path to package root directory -#' @param backup Create backup file? Default TRUE. -#' @return Invisibly returns TRUE if changes were made -#' -#' @export -#' @examples -#' \donttest{ -#' # Create a minimal package in tempdir -#' pkg <- file.path(tempdir(), "mypkg") -#' dir.create(pkg, recursive = TRUE, showWarnings = FALSE) -#' writeLines("Package: mypkg\nTitle: Test\nVersion: 0.1.0\nDescription: A test package.", -#' file.path(pkg, "DESCRIPTION")) -#' -#' fix_description_cran(pkg, backup = FALSE) -#' -#' # Clean up -#' unlink(pkg, recursive = TRUE) -#' } -fix_description_cran <- function(path = ".", backup = TRUE) { - desc_file <- file.path(path, "DESCRIPTION") - if (!file.exists(desc_file)) { - stop("No DESCRIPTION file found in ", path, call. = FALSE) - } - - # Read current content - desc <- read.dcf(desc_file) - dep_packages <- get_dependency_packages(desc) - check_names <- unique(c(dep_packages, KNOWN_SOFTWARE_NAMES)) - - made_changes <- FALSE - - # Fix Title - if ("Title" %in% colnames(desc)) { - old_title <- desc[1, "Title"] - new_title <- quote_names_in_text(old_title, check_names) - if (new_title != old_title) { - desc[1, "Title"] <- new_title - made_changes <- TRUE - message("Fixed Title: quoted package/software names") - } - } - - # Fix Description - if ("Description" %in% colnames(desc)) { - old_desc <- desc[1, "Description"] - new_desc <- quote_names_in_text(old_desc, check_names) - if (new_desc != old_desc) { - desc[1, "Description"] <- new_desc - made_changes <- TRUE - message("Fixed Description: quoted package/software names") - } - } - - if (made_changes) { - if (backup) { - backup_file <- paste0(desc_file, ".bak") - file.copy(desc_file, backup_file, overwrite = TRUE) - message("Backup saved to ", backup_file) - } - - write.dcf(desc, desc_file) - message("Updated ", desc_file) - } else { - message("No CRAN compliance issues to fix in DESCRIPTION") - } - - invisible(made_changes) -} +# Checks package code and examples for common CRAN issues. DESCRIPTION-field +# linting (software-name quoting, web-service links) is intentionally out of +# scope: tinyrox generates documentation, it is not a DESCRIPTION linter. #' Full CRAN Compliance Check #' -#' Runs all CRAN compliance checks (DESCRIPTION + code). +#' Runs the CRAN compliance checks for package code and examples. #' #' @param path Path to package root directory #' @return List with all issues @@ -375,15 +30,12 @@ fix_description_cran <- function(path = ".", backup = TRUE) { check_cran <- function(path = ".") { message("Checking CRAN compliance...") - desc_result <- check_description_cran(path) code_result <- check_code_cran(path) example_result <- check_examples_cran(path) - all_issues <- list(description = desc_result$issues, code = code_result, - examples = example_result) + all_issues <- list(code = code_result, examples = example_result) - has_issues <- desc_result$has_issues || length(code_result) > 0 || - length(example_result) > 0 + has_issues <- length(code_result) > 0 || length(example_result) > 0 if (!has_issues) { message("No CRAN compliance issues found") @@ -616,4 +268,3 @@ extract_function_name <- function(line) { } NULL } - diff --git a/R/document.R b/R/document.R index 4a770d7..6c1882f 100644 --- a/R/document.R +++ b/R/document.R @@ -10,8 +10,8 @@ #' \item{"append"}{Insert between ## tinyrox start/end markers} #' \item{"none"}{Don't modify NAMESPACE} #' } -#' @param cran_check Run CRAN compliance checks (DESCRIPTION quoting, -#' web service links, code issues, missing examples). Default TRUE. +#' @param cran_check Run CRAN compliance checks (code issues and missing +#' examples) and undocumented-parameter warnings. Default TRUE. #' @param silent Operate less verbose without messages. Default FALSE. #' @return Invisibly returns a list with: #' - rd_files: character vector of generated Rd file paths @@ -148,4 +148,3 @@ clean <- function(path = ".", namespace = FALSE) { invisible(NULL) } - diff --git a/R/namespace.R b/R/namespace.R index a8d56f9..f76c333 100644 --- a/R/namespace.R +++ b/R/namespace.R @@ -371,4 +371,3 @@ find_package_generics <- function(blocks) { unique(generics) } - diff --git a/R/parse.R b/R/parse.R index 40cfdcd..45f9721 100644 --- a/R/parse.R +++ b/R/parse.R @@ -339,4 +339,3 @@ parse_package <- function(path = ".") { all_blocks } - diff --git a/R/rd.R b/R/rd.R index e1872bc..78cd7f3 100644 --- a/R/rd.R +++ b/R/rd.R @@ -1072,4 +1072,3 @@ resolve_external_params <- function(source_name) { params } - diff --git a/R/tags.R b/R/tags.R index 3982429..7388f94 100644 --- a/R/tags.R +++ b/R/tags.R @@ -2,9 +2,9 @@ #' #' @keywords internal SUPPORTED_DOC_TAGS <- c("title", "description", "details", "param", - "return", "value", "examples", "example", - "seealso", "references", "aliases", "keywords", - "family", "name", "rdname", "noRd", + "return", "returns", "value", "examples", + "example", "seealso", "references", "aliases", + "keywords", "family", "name", "rdname", "noRd", "inheritParams", "section", "author") #' Supported Namespace Tags @@ -78,16 +78,20 @@ parse_tags <- function(lines, object_name, file = NULL, line_num = NULL) { } accumulator <- character() - # Validate tag + # Validate tag. An unknown tag is skipped with a warning rather + # than aborting the whole run (roxygen2's behavior): the tag stays + # current_tag, so its lines accumulate and are dropped by save_tag + # (no switch branch), while surrounding tags still parse. This keeps + # one unlisted tag from taking down document() for the package. if (!current_tag %in% SUPPORTED_TAGS) { location <- if (!is.null(file)) { paste0(" at ", basename(file), ":", line_num + i - 1) } else { "" } - stop("Unknown tag @", current_tag, location, - "\nSupported tags: ", paste(SUPPORTED_TAGS, collapse = ", "), - call. = FALSE) + warning("Unknown tag @", current_tag, location, " (skipped)", + "\nSupported tags: ", + paste(SUPPORTED_TAGS, collapse = ", "), call. = FALSE) } } else if (!is.null(current_tag)) { # Continuation of current tag @@ -204,6 +208,7 @@ save_tag <- function(result, tag, arg, accumulator, file, line_num) { } result$params[[param_name]] <- param_desc }, + "returns" =, "return" =, "value" = { result$return <- value @@ -302,4 +307,3 @@ save_tag <- function(result, tag, arg, accumulator, file, line_num) { result } - diff --git a/inst/tinytest/test_cran.R b/inst/tinytest/test_cran.R index 7e5fb02..810410c 100644 --- a/inst/tinytest/test_cran.R +++ b/inst/tinytest/test_cran.R @@ -1,91 +1,4 @@ -# Tests for CRAN compliance checking - -# Test get_dependency_packages -test_deps <- function() { - desc <- matrix( - c("mypkg", "A Package", "torch, av, jsonlite (>= 1.0)", "tinytest"), - nrow = 1, - dimnames = list(NULL, c("Package", "Title", "Imports", "Suggests")) - ) - - pkgs <- tinyrox:::get_dependency_packages(desc) - expect_true("torch" %in% pkgs) - expect_true("av" %in% pkgs) - expect_true("jsonlite" %in% pkgs) - expect_true("tinytest" %in% pkgs) - expect_equal(length(pkgs), 4) -} -test_deps() - -# Test find_unquoted_names -test_unquoted <- function() { - # Unquoted torch should be found - text1 <- "This uses torch for deep learning" - expect_true("torch" %in% tinyrox:::find_unquoted_names(text1, "torch")) - - # Quoted 'torch' should NOT be found - text2 <- "This uses 'torch' for deep learning" - expect_equal(length(tinyrox:::find_unquoted_names(text2, "torch")), 0) - - # Mixed: one quoted, one not - text3 <- "Uses 'torch' and also torch tensors" - expect_true("torch" %in% tinyrox:::find_unquoted_names(text3, "torch")) - - # Multiple names - text4 <- "Uses torch and OpenAI models" - unquoted <- tinyrox:::find_unquoted_names(text4, c("torch", "OpenAI")) - expect_true("torch" %in% unquoted) - expect_true("OpenAI" %in% unquoted) -} -test_unquoted() - -# Test quote_names_in_text -test_quoting <- function() { - # Simple case - text1 <- "Uses torch for inference" - fixed1 <- tinyrox:::quote_names_in_text(text1, "torch") - expect_equal(fixed1, "Uses 'torch' for inference") - - # Already quoted - should not double-quote - - text2 <- "Uses 'torch' for inference" - fixed2 <- tinyrox:::quote_names_in_text(text2, "torch") - expect_equal(fixed2, "Uses 'torch' for inference") - - # Multiple occurrences - text3 <- "torch is great, torch is fast" - fixed3 <- tinyrox:::quote_names_in_text(text3, "torch") - expect_equal(fixed3, "'torch' is great, 'torch' is fast") - - # Mixed quoted and unquoted - text4 <- "'torch' is great but torch needs quoting" - fixed4 <- tinyrox:::quote_names_in_text(text4, "torch") - expect_equal(fixed4, "'torch' is great but 'torch' needs quoting") -} -test_quoting() - -# Test escape_regex -test_escape <- function() { - # Dots should be escaped - expect_equal(tinyrox:::escape_regex("data.table"), "data\\.table") - # Normal text unchanged - expect_equal(tinyrox:::escape_regex("torch"), "torch") -} -test_escape() - -# Test check_webservice_links -test_weblinks <- function() { - # hfhub without huggingface link - desc1 <- "Downloads models from the hub" - missing1 <- tinyrox:::check_webservice_links(desc1, "hfhub") - expect_true("hfhub" %in% names(missing1)) - - # hfhub with huggingface link - should not warn - desc2 <- "Downloads from huggingface.co via hfhub" - missing2 <- tinyrox:::check_webservice_links(desc2, "hfhub") - expect_equal(length(missing2), 0) -} -test_weblinks() +# Tests for CRAN compliance checking (code + example checks) # Test find_dontrun_examples test_dontrun <- function() { diff --git a/inst/tinytest/test_tags.R b/inst/tinytest/test_tags.R index 476b506..beec970 100644 --- a/inst/tinytest/test_tags.R +++ b/inst/tinytest/test_tags.R @@ -46,12 +46,19 @@ tags_desc <- tinyrox:::parse_tags(lines_desc, "foo") expect_true(grepl("multiline", tags_desc$description)) expect_true(grepl("three lines", tags_desc$description)) -# Test unknown tag error -expect_error( +# Unknown tag warns and is skipped (roxygen2 behavior), not a hard error +expect_warning( tinyrox:::parse_tags(c("@unknowntag value"), "foo"), pattern = "Unknown tag" ) +# A skipped unknown tag does not take down surrounding tags +tags_skip <- suppressWarnings( + tinyrox:::parse_tags(c("Title", "@bogus nope", "@return The value"), "foo") +) +expect_equal(tags_skip$title, "Title") +expect_equal(tags_skip$return, "The value") + # Test @importFrom lines_import <- c("Title", "@importFrom stats lm glm") tags_import <- tinyrox:::parse_tags(lines_import, "foo") @@ -105,3 +112,13 @@ tags_md <- tinyrox:::parse_tags(lines_multiline_desc, "foo") expect_true(grepl("Line one", tags_md$description)) expect_true(grepl("Line two", tags_md$description)) expect_equal(tags_md$details, "Now details.") + +# @returns is accepted as a plural alias of @return (roxygen2 supports both) (#24) +lines_returns <- c("Title", "@returns The result value") +tags_returns <- tinyrox:::parse_tags(lines_returns, "foo") +expect_equal(tags_returns$return, "The result value") + +# @returns and @return land in the same slot +lines_return <- c("Title", "@return The result value") +tags_return <- tinyrox:::parse_tags(lines_return, "foo") +expect_equal(tags_returns$return, tags_return$return) diff --git a/man/SUPPORTED_DOC_TAGS.Rd b/man/SUPPORTED_DOC_TAGS.Rd index 19e657e..90b3604 100644 --- a/man/SUPPORTED_DOC_TAGS.Rd +++ b/man/SUPPORTED_DOC_TAGS.Rd @@ -4,7 +4,7 @@ \alias{SUPPORTED_DOC_TAGS} \title{Supported Documentation Tags} \format{ -An object of class \code{character} of length 19. +An object of class \code{character} of length 20. } \usage{ SUPPORTED_DOC_TAGS diff --git a/man/SUPPORTED_TAGS.Rd b/man/SUPPORTED_TAGS.Rd index e5ae2f1..ba88416 100644 --- a/man/SUPPORTED_TAGS.Rd +++ b/man/SUPPORTED_TAGS.Rd @@ -4,7 +4,7 @@ \alias{SUPPORTED_TAGS} \title{All Supported Tags} \format{ -An object of class \code{character} of length 25. +An object of class \code{character} of length 26. } \usage{ SUPPORTED_TAGS diff --git a/man/check_cran.Rd b/man/check_cran.Rd index ad53c78..b4e0050 100644 --- a/man/check_cran.Rd +++ b/man/check_cran.Rd @@ -12,7 +12,7 @@ check_cran(path = ".") List with all issues } \description{ -Runs all CRAN compliance checks (DESCRIPTION + code). +Runs the CRAN compliance checks for package code and examples. } \examples{ \donttest{ diff --git a/man/check_description_cran.Rd b/man/check_description_cran.Rd deleted file mode 100644 index 64a2cb0..0000000 --- a/man/check_description_cran.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{check_description_cran} -\alias{check_description_cran} -\title{Check DESCRIPTION for CRAN Compliance} -\usage{ -check_description_cran(path = ".", fix = FALSE) -} -\arguments{ -\item{path}{Path to package root directory} - -\item{fix}{If TRUE, return fixed text. If FALSE, just warn.} -} -\value{ -List with validation results and optionally fixed text -} -\description{ -Validates Title and Description fields for common CRAN issues: -unquoted package names, missing web service links, etc. -} -\examples{ -\donttest{ -# Create a minimal package in tempdir -pkg <- file.path(tempdir(), "mypkg") -dir.create(pkg, recursive = TRUE, showWarnings = FALSE) -writeLines("Package: mypkg\nTitle: Test\nVersion: 0.1.0\nDescription: A test package.", - file.path(pkg, "DESCRIPTION")) - -check_description_cran(pkg) - -# Clean up -unlink(pkg, recursive = TRUE) -} -} diff --git a/man/check_webservice_links.Rd b/man/check_webservice_links.Rd deleted file mode 100644 index f5a6c40..0000000 --- a/man/check_webservice_links.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{check_webservice_links} -\alias{check_webservice_links} -\title{Check for Missing Web Service Links} -\usage{ -check_webservice_links(description, packages) -} -\arguments{ -\item{description}{Description text} - -\item{packages}{Package names from dependencies} -} -\value{ -Named list of packages missing links (name = URL) -} -\description{ -Checks if packages that typically use web services have -corresponding URLs in the Description. -} diff --git a/man/document.Rd b/man/document.Rd index 8d495e3..db762df 100644 --- a/man/document.Rd +++ b/man/document.Rd @@ -16,8 +16,8 @@ document(path = ".", namespace = c("overwrite", "append", "none"), \item{"none"}{Don't modify NAMESPACE} }} -\item{cran_check}{Run CRAN compliance checks (DESCRIPTION quoting, -web service links, code issues, missing examples). Default TRUE.} +\item{cran_check}{Run CRAN compliance checks (code issues and missing +examples) and undocumented-parameter warnings. Default TRUE.} \item{silent}{Operate less verbose without messages. Default FALSE.} } diff --git a/man/escape_regex.Rd b/man/escape_regex.Rd deleted file mode 100644 index a409783..0000000 --- a/man/escape_regex.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{escape_regex} -\alias{escape_regex} -\title{Escape Regex Special Characters} -\usage{ -escape_regex(x) -} -\arguments{ -\item{x}{String to escape} -} -\value{ -Escaped string safe for use in regex -} -\description{ -Escape Regex Special Characters -} diff --git a/man/find_unquoted_names.Rd b/man/find_unquoted_names.Rd deleted file mode 100644 index 089ebf8..0000000 --- a/man/find_unquoted_names.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{find_unquoted_names} -\alias{find_unquoted_names} -\title{Find Unquoted Names in Text} -\usage{ -find_unquoted_names(text, names) -} -\arguments{ -\item{text}{Text to search} - -\item{names}{Names to look for} -} -\value{ -Character vector of unquoted names found -} -\description{ -Finds package/software names that appear without single quotes. -} diff --git a/man/fix_description_cran.Rd b/man/fix_description_cran.Rd deleted file mode 100644 index fb64e93..0000000 --- a/man/fix_description_cran.Rd +++ /dev/null @@ -1,32 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{fix_description_cran} -\alias{fix_description_cran} -\title{Fix DESCRIPTION File} -\usage{ -fix_description_cran(path = ".", backup = TRUE) -} -\arguments{ -\item{path}{Path to package root directory} - -\item{backup}{Create backup file? Default TRUE.} -} -\value{ -Invisibly returns TRUE if changes were made -} -\description{ -Automatically fixes common CRAN issues in DESCRIPTION. -} -\examples{ -\donttest{ -# Create a minimal package in tempdir -pkg <- file.path(tempdir(), "mypkg") -dir.create(pkg, recursive = TRUE, showWarnings = FALSE) -writeLines("Package: mypkg\nTitle: Test\nVersion: 0.1.0\nDescription: A test package.", - file.path(pkg, "DESCRIPTION")) - -fix_description_cran(pkg, backup = FALSE) - -# Clean up -unlink(pkg, recursive = TRUE) -} -} diff --git a/man/get_dependency_packages.Rd b/man/get_dependency_packages.Rd deleted file mode 100644 index 437b37d..0000000 --- a/man/get_dependency_packages.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{get_dependency_packages} -\alias{get_dependency_packages} -\title{Extract Package Names from Dependencies} -\usage{ -get_dependency_packages(desc) -} -\arguments{ -\item{desc}{DESCRIPTION matrix from read.dcf()} -} -\value{ -Character vector of package names -} -\description{ -Parses Imports, Suggests, Depends, and Enhances fields. -} diff --git a/man/quote_names_in_text.Rd b/man/quote_names_in_text.Rd deleted file mode 100644 index 9a5927c..0000000 --- a/man/quote_names_in_text.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% tinyrox says don't edit this manually, but it can't stop you! -\name{quote_names_in_text} -\alias{quote_names_in_text} -\title{Quote Names in Text} -\usage{ -quote_names_in_text(text, names) -} -\arguments{ -\item{text}{Text to modify} - -\item{names}{Names to quote} -} -\value{ -Modified text with names quoted -} -\description{ -Wraps unquoted package/software names in single quotes. -}