Repository navigation
[Linting Rule] Seeded Randomness
Generated from 'wiki-linter.ts' on 2026-10-27, 10:46:55 UTC (v2.16.6), do not edit directly.
Seeded Randomness [overview]
This rule is a best-effort rule.
Finds randomness-based function calls not preceded by a random seed generation function. For consistent reproducibility, functions that use randomness should only be called after a constant random seed is set using a function like set.seed.
This linting rule is implemented in src/linter/rules/seeded-randomness.ts.
Linting rules can be configured by passing a configuration object to the linter query as shown in the example below.
The seeded-randomness rule accepts the following configuration options:
-
randomnessConsumers
A set of randomness consumer function names that require a seed to be set prior to invocation. -
randomnessProducers
A set of functions and variables whose invocation or assignment causes a random seeded to be set. Each entry has atype, which is eitherfunctionorassignment, and aname, which is the name of the function or variable. The default value for this is the functionset.seedand the variable.Random.seed.
runif(1)The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "seeded-randomness", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (1 ms)
╰ Seeded Randomness (seeded-randomness):
╰ certain:
╰ Function runif at 1.1-8
More examples are the test cases in test/functionality/linter/lint-seeded-randomness.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