Skip to content

[Linting Rule] Description Metadata

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.

Description Metadata [overview]

cmd-check 1, 6, 25–27

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

# Step Coverage Note
1 for file 'DESCRIPTION' (book) 🟩⭐ ⭐ also reports every problem instead of stopping at the first
6 package bundle (book) 🔶
25 DESCRIPTION meta-information (book) 🟩
26 CRAN incoming feasibility (book) 🔶 the DESCRIPTION based notes, repository queries are left out
27 package dependencies (book) 🔷 availability and versions asked of the signature database instead of the repositories

This rule is a best-effort rule.

Finds problems in the DESCRIPTION: required fields, package name, version, maintainer, dependency fields, license, Authors@R, encoding, and the Title and Description style CRAN asks for.
This linting rule is implemented in src/linter/rules/cmd-check/description-metadata.ts.

Configuration

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

  • cranIncoming
    also run the style checks R CMD check --as-cran adds for the Title, Description, and Authors@R fields (default true)
    R CMD check #25, #26
  • maxDepends
    how many non-default packages Depends may list before it is reported, as R CMD check does after five (default 5)
    R CMD check #27
  • maxImports
    how many non-base packages Imports may list before it is reported, 0 for no limit as R CMD check does by default (default 0)
    R CMD check #27

Examples

A project with the code R/code.R:

x <- 1

and the files

DESCRIPTION:

Package: pkg
Version: 1.0
Title: A Package
License: GPL-3 + file LICENSE

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

[ { "type": "linter",   "rules": [ { "name": "description-metadata",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (3 ms)
   ╰ Description Metadata (description-metadata):
       ╰ certain:
           ╰ Required field missing or empty: 'Description' at /pkg/DESCRIPTION:1.1
           ╰ Required field missing or empty: 'Author' at /pkg/DESCRIPTION:1.1
           ╰ Required field missing or empty: 'Maintainer' at /pkg/DESCRIPTION:1.1
           ╰ Invalid license file pointers: LICENSE at /pkg/DESCRIPTION:4.1-29
           ╰ The Title field starts with the package name. at /pkg/DESCRIPTION:3.1-16

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

Clone this wiki locally