tinyactors lint

Find what cannot work as written in charts.

Usage

shell
tinyactors lint [options] INPUT...

Reads the charts' states, transitions, raises and sends without running them. Reports what cannot do what it is written for, by rule. unreachable: a state no path enters. dead-end: a state an actor never leaves. never-ends: a state from which no final state is reachable. shadowed: a transition an earlier one always takes first. eventless-loop: an eventless transition taken without end. unhandled-event: raised or sent to a chart of the image that handles it nowhere. unsent-event: with several charts, handled but sent by nothing in the image. unknown-events: a computed event may arrive, so unsent-event is not checked. send-target: a static target no send can reach. search-limit: the search stopped at its limit, so never-ends is not checked.

Options

  • -W, --warnings-as-errorsRefuse a chart that compiles with a warning.
  • -I, --include DIRSearch DIR for a src that is not beside the file naming it, in the order given. Repeatable.
  • -c, --chart NAMELook at the chart named NAME only. Repeatable.
  • -s, --segment NRead the image that segment N of a snapshot runs. Default: the newest live segment.
  • -d, --deny RULEExit with 1 when RULE finds something; all names every rule. Repeatable.
  • -a, --allow RULELeave out the findings of RULE; all leaves out every rule's. Repeatable.

Configure output formats like -f json using the shared options on the command reference.

Examples

shell
tinyactors lint order.scxml
output
# Lint

- **Warnings**: 0
- **Notes**: 0
- **Denied**: 0

## Findings

_none_

Lint a chart.

shell
tinyactors lint --deny all --allow unsent-event system.xml
output
# Lint

- **Warnings**: 0
- **Notes**: 0
- **Denied**: 0

## Findings

_none_

Fail on a finding of every rule but unsent-event.

shell
tinyactors lint -f json --chart payment shop.tai
output
{
  "warnings": 0,
  "notes": 4,
  "denied": 0,
  "findings": [
    {
      "rule": "unsent-event",
      "severity": "note",
      "chart": "payment",
      "state": "pending",
      "transition": "authorize → authorized",
      "event": "authorize",
      "line": 0,
      "message": "nothing in the image raises or sends it to payment: only the application can"
    },
    {
      "rule": "unsent-event",
      "severity": "note",
      "chart": "payment",
      "state": "pending",
      "transition": "decline → declined",
      "event": "decline",
      "line": 0,
      "message": "nothing in the image raises or sends it to payment: only the application can"
    },
    {
      "rule": "unsent-event",
      "severity": "note",
      "chart": "payment",
      "state": "authorized",
      "transition": "capture → settled",
      "event": "capture",
      "line": 0,
      "message": "nothing in the image raises or sends it to payment: only the application can"
    },
    {
      "rule": "unsent-event",
      "severity": "note",
      "chart": "payment",
      "state": "authorized",
      "transition": "void → declined",
      "event": "void",
      "line": 0,
      "message": "nothing in the image raises or sends it to payment: only the application can"
    }
  ]
}

Lint one chart of an image as JSON.

Exit status

  • 1An input is refused: it does not compile or verify, or it is damaged or of an unknown format.
  • 1A rule given to --deny finds something.
  • 3A file cannot be read or written, or memory runs out.

Related pages