Skip to content

[Linting Rule] Call Arguments

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.

Call Arguments [overview]

bug cmd-check 37 quickfix robustness

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

# Step Coverage Note
37 R code for possible problems (book) 🟩⭐ ⭐ also quick fixes, deprecated arguments, environments resolved through variables, hooks followed into callees

This rule is a best-effort rule.

Finds calls with arguments the called function does not take, names that match a formal only partially or match several formals, ... used in a function without ..., and local functions defined twice with different formals. Calls are resolved through the dataflow graph.
This linting rule is implemented in src/linter/rules/cmd-check/call-arguments.ts.

Configuration

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

  • checkPackageFunctions
    also check calls of functions from other packages, whose formals the signature database states (default true)
    R CMD check #37
  • reportPartialMatches
    report arguments that only match a formal by a prefix of its name (default true, as R CMD check does)
    R CMD check #37

Examples

scale_by <- function(x, factor) x * factor
f <- function(x) scale_by(x, fact = 2, center = TRUE)

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

[ { "type": "linter",   "rules": [ { "name": "call-arguments",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (3 ms)
   ╰ Call Arguments (call-arguments):
       ╰ certain:
           ╰ partial-match in scale_by (fact) at 2.18-53 (1 quick fix(es) available)
           ╰ unused-named in scale_by (center) at 2.18-53

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

Clone this wiki locally