An open API service indexing awesome lists of open source software.

https://github.com/taro-kayo/statelint

A PyPI package providing a validator for Amazon States Language JSON/YAML files.
https://github.com/taro-kayo/statelint

aws cli pypi python step-functions validator

Last synced: 3 months ago
JSON representation

A PyPI package providing a validator for Amazon States Language JSON/YAML files.

Awesome Lists containing this project

README

          

# statelint

Actions Status
Coverage Status
License: Apache License 2.0
PyPI
[![Downloads](https://static.pepy.tech/badge/statelint/month)](https://pepy.tech/project/statelint)

A PyPI package providing a validator for [Amazon States Language](https://states-language.net/spec.html) JSON/YAML files.

This package is based on Amazon Web Services Labs' [awslabs/statelint](https://github.com/awslabs/statelint).

## Installation

```shell
pip install statelint
```

## Usage

```shell
statelint fancy-state-machine-spec.json
```

If you prefer YAML, you need to install [PyYaml](https://pypi.org/project/PyYAML/).

```shell
pip install PyYAML
```

Then, run command with a `--yaml` parameter.

```shell
statelint --yaml fancy-state-machine-spec.yaml
```

If you don't like to be complained that `BackoffRate` doesn't end with ".0",
pass a `--ignore=FLOAT` parameter.

```shell
statelint --ignore=FLOAT fancy-state-machine-spec.json
```

If your `Resource` doesn't contain URI string,
pass a `--ignore=URI` parameter.

```shell
statelint --ignore=URI fancy-state-machine-spec.json
```

You can pass both parameters at the same time.

```shell
statelint --ignore=FLOAT,URI fancy-state-machine-spec.json
```

## 🚀 JSONata Evaluation (Experimental)

If you are using [JSONata](https://docs.aws.amazon.com/step-functions/latest/dg/transforming-data.html), you may be able to reduce false positives by passing the `--eval-jsonata` flag.

This feature is currently **experimental** (and might just stay that way 😉).

However, this library only references variables assigned in the `"Assign"` field (i.e., $states is not supported) and **does not** support the JSONata format _within_ the `"Assign"` field itself.

To use this feature, you must install [jsonata-python](https://github.com/rayokota/jsonata-python):

```shell
pip install jsonata-python
```

### Usage Example:

```shell
statelint --eval-jsonata fancy-state-machine-spec.json
```