Repository navigation
[Linting Rule] Package Structure
Generated from 'wiki-linter.ts' on 2026-10-25, 09:29:25 UTC (v2.16.6), do not edit directly.
Package Structure [overview]
This rule ports the following steps of R CMD check (see the conformance table for the legend):
This rule is a best-effort rule.
Finds problems in the package files: portable names, hidden files, top-level files, subdirectories, permissions, executables, timestamps, sizes, line endings of scripts, and vignette leftovers.
This linting rule is implemented in src/linter/rules/cmd-check/package-structure.ts.
Linting rules can be configured by passing a configuration object to the linter query as shown in the example below.
The package-structure rule accepts the following configuration options:
-
builtPackage
whether the package is a built tarball (soinst/docis expected to hold the vignette outputs)
R CMD check #21 -
checkBashisms
whether to flag/bin/bashandenv bashinconfigureandcleanup(off inR CMD checkby default)
R CMD check #14 -
checkFutureTimestamps
whether to flag files and directories modified in the future (R CMD checkdoes with--as-cran)
R CMD check #13 -
checkTopLevel
whether to check for non-standard top-level files and directories (R CMD checkdoes with--as-cran)
R CMD check #14 -
cranKnownHidden
names of hidden files and directories the CRAN package checks know about
R CMD check #11 -
cranPack
whether to say for each hidden file whether the CRAN package checks know about it
R CMD check #11 -
docDirsNotInstalled
the directories ofinst/docthat should not be installed
R CMD check #23 -
hiddenAllowed
hidden files and directories (as paths relative to the package root) that are fine
R CMD check #11 -
leftoverExtensions
the extensions (without dot) of files that are leftovers when found next to vignettes
R CMD check #21, #23 -
maxInstalledSizeMb
the installed package size in Mb above which a note is given (default5)
R CMD check #18 -
maxPathLength
a path of more than this many bytes (with the package name as prefix) is noted (default100)
R CMD check #8 -
maxPdfBytes
a PDF ininst/docof more bytes than this is flagged to be compacted (default 1 MiB)
R CMD check #19 -
reservedInstDirs
the directories ofinstthat R uses itself
R CMD check #16 -
standardTopLevel
the files and directories that may be at the top level of a package
R CMD check #14
A project with the code R/code.R:
f <- function() 1and the files
DESCRIPTION:
Package: pkg
Version: 1.0
Title: A Package
License: MIT
R/a:b.R:
g <- function() 2The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "package-structure", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (1 ms)
╰ Package Structure (package-structure):
╰ certain:
╰ Found the following file with a non-portable file name: 'R/a:b.R'. This is not a valid file name on all R platforms; please rename the file. at /pkg/R/a:b.R:1.1
More examples are the test cases in test/functionality/linter/cmd-check/lint-package-structure.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