Skip to content

Other conventions

Snake case formatting

A consistent way of formatting and writing code helps scenario developers to more easily read and understand scenario code and to work collaboratively.

Convention

Snake case is the official Foretellix formatting for code items such as actors, metrics, coverage items, and so on, as well as for file names. In snake case each letter is in lower case and white space between words or hyphens are replaced by underscores.

Note

In general OSC2 supports multiple formatting options, as described in user-defined identifiers.

Examples

OSC2 code: snake case
TTC # should be ttc
Cut-In_Vehicle # should be cut_in_vehicle

Linter rule name

LINT_SNAKE_CASE

Use of physical units

Units should typically be SI units as shown in the table below.

Type Default Unit to be used In OSC2
Time seconds s
Distance meter m
Speed kilometer per hour kph
Acceleration meter per second squared mpsps

Linter rule name

LINT_METRICS_BAD_UNIT