checkModuleMetadata: Statically check a SpaDES module file for malformed metadata

View source: R/module-malformed.R

checkModuleMetadataR Documentation

Statically check a SpaDES module file for malformed metadata

Description

Scans a module source file for common authoring mistakes that produce cryptic R parse errors or surface only deep inside simInit(). Returns a character vector of findings, or invisibly an empty vector if the file looks clean.

Usage

checkModuleMetadata(file, stopOnFirst = FALSE)

Arguments

file

Path to a module's main .R file.

stopOnFirst

Logical. If TRUE (default), throw an error on the first detector that fires. If FALSE, run every detector and return the full vector of findings.

Details

The detector set is intentionally modular: to add a new check, add an entry to the internal .CC_MALFORMED_CHECKS registry — each entry is a function (input) -> NULL | character(1).

Value

A character vector of findings (empty if none). When stopOnFirst = TRUE and a problem is found, throws an error instead.


SpaDES.core documentation built on May 23, 2026, 5:07 p.m.