Repository navigation
[Linting Rule] Documentation Mismatch
Generated from 'wiki-linter.ts' on 2026-11-08, 14:25:27 UTC (v2.17.4), do not edit directly.
Documentation Mismatch [overview]
This rule ports the following steps of R CMD check (see the conformance table for the legend):
| # | Step | Coverage | Note |
|---|---|---|---|
| 44 | package namespace information (book) | 🔶 | |
| 48 | for missing documentation entries (book) | 🟩 | S4 classes and methods are not checked |
| 49 | for code/documentation mismatches (book) | 🟩 | data sets and S4 classes are not compared |
| 50 | Rd \usage sections (book) | 🟩 |
This rule is a best-effort rule.
Finds exported objects without documentation, functions whose formals differ from their \usage, and arguments missing from or extra in \arguments.
This linting rule is implemented in src/linter/rules/cmd-check/documentation-mismatch.ts.
Linting rules can be configured by passing a configuration object to the linter query as shown in the example below.
The documentation-mismatch rule accepts the following configuration options:
-
checkCodoc
report functions whose formals differ from their\usage
R CMD check #49 -
checkDefaults
also report default values that differ between the code and its\usage
R CMD check #49 -
checkInternalUsage
also check the\usageof pages with the keywordinternal
R CMD check #50 -
checkUndocumented
report exported objects no Rd page documents
R CMD check #48 -
checkUsage
report arguments of a\usagethat its\argumentsdo not document, and documented arguments no\usagehas
R CMD check #50 -
requireDocumentation
report undocumented objects even when the package has no Rd pages at all
R CMD check #48
A project with the code R/code.R:
f <- function(x, y) x + yand the files
DESCRIPTION:
Package: pkg
Version: 1.0
Title: A Package
License: MIT
NAMESPACE:
export(f)
man/f.Rd:
\name{f}
\alias{f}
\title{Add}
\usage{f(x)}
\arguments{\item{x}{a number}}
The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "documentation-mismatch", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (11 ms)
╰ Documentation Mismatch (documentation-mismatch):
╰ certain:
╰ Codoc mismatches from Rd file 'f.Rd': f(x) in the docs, but f(x, y) in the code at /pkg/man/f.Rd:4.8
More examples are the test cases in test/functionality/linter/cmd-check/lint-documentation-mismatch.test.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information