Skip to content

[Linting Rule] Interactive Functions

github-actions[bot] edited this page Nov 27, 2026 · 1 revision

Generated from 'wiki-linter.ts' on 2026-11-11, 08:13:04 UTC (v2.17.5), do not edit directly.

Interactive Functions [overview]

smell reproducibility robustness

This rule is a best-effort rule.

Finds calls that only do their job in an interactive session, such as View, edit, browser, or debug, left in a script, where Rscript skips or stops at them. A call in the branch an interactive() check takes is fine, one within a function is uncertain, as the function may only be meant for interactive use.
This linting rule is implemented in src/linter/rules/interactive-functions.ts.

Configuration

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

  • fns
    The functions that only do their job in an interactive session, by default every built-in tagged SemanticCallTag.Interactive

Examples

p <- penguins
View(p)
if(interactive()) browser()

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

[ { "type": "linter",   "rules": [ { "name": "interactive-functions",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (55 ms)
   ╰ Interactive Functions (interactive-functions):
       ╰ certain:
           ╰ Function utils::View at 3.1-7

More examples are the test cases in test/functionality/linter/lint-interactive-functions.test.ts.

Clone this wiki locally