pkgcheck

Maintenance of pkgcheck package.

Adding new checks

The procedure for adding new checks is documented in the Extending or modifying checks” vignette within the pkgcheck package. The roreviewapi package which delivers the checks to rOpenSci’s GitHub issues directly dumps all checks currently delivered by pkgcheck. See the following section for options for restricting which checks are delivered.

Controlling checks in roreviewapi

The addition of new checks is fairly straightforward, and described in the above section, along with corresponding links. The remainder of this section describes how the roreviewapi may be modified to deliver a reduced set of checks than the full set returned by pkgcheck.

The plumber endpoint for editor checks is entirely controlled by the roreviewapi::editor_check() function. The main call is via tryCatch to ensure any errors are captured:

checks <- tryCatch (pkgcheck::pkgcheck (path),
                    error = function (e) e)

The return object, checks, is a list of checks ultimately composed in the main pkgcheck() function definition. The easiest way to remove checks from the roreviewpi without modifying the underlying structure of pkgcheck itself is to run the checks as above, and then remove the corresponding list items. For example, the following modification would suffice to remove the scrap check (which checks whether a repository contains “scrap” files which should not be included) from the API endpoint:

checks <- tryCatch (pkgcheck::pkgcheck (path),
                    error = function (e) e)
checks$scrap <- NULL

When those checks are printed (via print) or summarised (via summarise), the scrap checks will not be reported on. This procedure can be used to remove checks from the roreviewapi results, by finding the line in the roreviewapi::editor_check() function where the main pkgcheck::pkgcheck() function is called, and then removing any checks immediately afterward by setting them to NULL. Those checks will then be removed from the report delivered by roreviewpi, and therefore by the ropensci-review-bot.