<!-- https://tinyactors.dev/cli/commands/lint/ -->
# tinyactors lint

Kind: reference. For: [Workflow developer who tests](https://tinyactors.dev/audiences/workflow-tester.xml), [Agent-platform engineer](https://tinyactors.dev/audiences/agent-platform.xml).
Voice: [Reference](https://tinyactors.dev/voices/reference.xml).

> Find what cannot work as written in charts.

Find what cannot work as written in charts.

<a id="usage"></a>

## 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.

<a id="options"></a>

## Options

- **`-W, --warnings-as-errors`**: Refuse a chart that compiles with a warning.
- **`-I, --include DIR`**: Search `DIR` for a src that is not beside the file naming it, in the order given. Repeatable.
- **`-c, --chart NAME`**: Look at the chart named `NAME` only. Repeatable.
- **`-s, --segment N`**: Read the image that segment N of a snapshot runs. Default: the newest live segment.
- **`-d, --deny RULE`**: Exit with 1 when `RULE` finds something; all names every rule. Repeatable.
- **`-a, --allow RULE`**: Leave 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](https://tinyactors.dev/cli/commands/index.md#program-options).

<a id="examples"></a>

## Examples

```shell
tinyactors lint order.scxml
```

```text title="output"
# Lint

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

## Findings

_none_
```

Lint a chart.

```shell
tinyactors lint --deny all --allow unsent-event system.xml
```

```text title="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
```

```text title="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.

<a id="exit-status"></a>

## Exit status

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

<a id="see"></a>

## Related pages

- [CI checks](https://tinyactors.dev/cli/guides/ci/index.md)
- **[`tinyactors compile`](https://tinyactors.dev/cli/commands/compile/index.md)**: Compile charts or a system manifest into an image.
- **[`tinyactors check`](https://tinyactors.dev/cli/commands/check/index.md)**: Check that charts compile or that an image verifies.
- **[`tinyactors fmt`](https://tinyactors.dev/cli/commands/fmt/index.md)**: Rewrite charts and system manifests in the canonical layout.

## Commands

- [tinyactors compile](https://tinyactors.dev/cli/commands/compile/)
- [tinyactors check](https://tinyactors.dev/cli/commands/check/)
- [tinyactors inspect](https://tinyactors.dev/cli/commands/inspect/)
- [tinyactors states](https://tinyactors.dev/cli/commands/states/)
- [tinyactors transitions](https://tinyactors.dev/cli/commands/transitions/)
- [tinyactors events](https://tinyactors.dev/cli/commands/events/)
- [tinyactors data](https://tinyactors.dev/cli/commands/data/)
- [tinyactors expressions](https://tinyactors.dev/cli/commands/expressions/)
- [tinyactors disassemble](https://tinyactors.dev/cli/commands/disassemble/)
- [tinyactors graph](https://tinyactors.dev/cli/commands/graph/)
- [tinyactors diff](https://tinyactors.dev/cli/commands/diff/)
- [tinyactors lint](https://tinyactors.dev/cli/commands/lint/)
- [tinyactors path](https://tinyactors.dev/cli/commands/path/)
- [tinyactors fmt](https://tinyactors.dev/cli/commands/fmt/)
- [tinyactors actors](https://tinyactors.dev/cli/commands/actors/)
- [tinyactors run](https://tinyactors.dev/cli/commands/run/)
- [tinyactors help](https://tinyactors.dev/cli/commands/help/)
- [tinyactors version](https://tinyactors.dev/cli/commands/version/)
