Ensure dontrun Wrapping Around @examples
checkPkg_add_roxygen_dontrun.RdThis function checks all R script files in a specified folder to ensure that all `@examples` sections in Roxygen documentation are wrapped in dontrun. It ensures proper package building and simplifies function documentation development for users.
Details
The function performs the following checks on each script: - Ensures the script contains only one function. - Verifies that Roxygen documentation is present. - Checks if an `@examples` section exists. - Ensures dontrun is not already present around the `@examples` section.
If all conditions are met, the function automatically adds dontrun around the `@examples` section and relocates the `@export` tag if it appears after the `@examples` section.