Skip to content

[Linting Rule] Package Metafiles

github-actions[bot] edited this page Oct 25, 2026 · 1 revision

Generated from 'wiki-linter.ts' on 2026-10-25, 09:29:25 UTC (v2.16.6), do not edit directly.

Package Metafiles [overview]

cmd-check 56–59 robustness

This rule ports the following steps of R CMD check (see the conformance table for the legend):

# Step Coverage Note
56 index information (book) 🟩 the vignette index of inst/doc is not checked
57 demos (book) 🔷 the demo index and file names, the demos are not run
58 package subdirectories (CITATION) (book) 🟩⭐ ⭐ also the superseded citEntry and personList
the CITATION file is parsed, not evaluated
59 relative paths in package URLs (book) 🔷⭐ ⭐ also links in README and NEWS
relative URLs in Rd files are not checked

This rule is a best-effort rule.

Finds problems in the demo index, INDEX, inst/CITATION, and relative links in README, NEWS, and vignettes.
This linting rule is implemented in src/linter/rules/cmd-check/package-metafiles.ts.

Configuration

Linting rules can be configured by passing a configuration object to the linter query as shown in the example below. The package-metafiles rule accepts the following configuration options:

  • citation
    check inst/CITATION (its syntax, entry types and required fields) and the location of other CITATION files (default true)
    R CMD check #58
  • index
    check the INDEX and the demo/00Index of the package (default true)
    R CMD check #56, #57
  • relativeLinks
    check that the relative links of the README, NEWS and vignettes point to files of the package (default true)
    R CMD check #59
  • superseded
    report the citation functions superseded by a newer one, which R CMD check accepts (default true)
    R CMD check #58

Examples

A project with the code R/code.R:

f <- function() 1

and the files

DESCRIPTION:

Package: pkg
Version: 1.0
Title: A Package
License: MIT

demo/a.R:

f()

demo/b.R:

f() + 1

demo/00Index:

a    A first demo

The linting query can be used to run this rule on the above example:

[ { "type": "linter",   "rules": [ { "name": "package-metafiles",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (1 ms)
   ╰ Package Metafiles (package-metafiles):
       ╰ certain:
           ╰ undocumented-demo in demo/b.R at /pkg/demo/b.R:1.1

More examples are the test cases in test/functionality/linter/cmd-check/lint-package-metafiles.test.ts.

Clone this wiki locally