#!/usr/bin/env bash
set -euxo pipefail

# Used for shellcheck which needs explicit args
scripts=("$PWD"/scripts/*.sh "$PWD"/e2e/{test_,run_}* "$PWD"/e2e/*.sh)
# Used for shfmt which will run only on files it can
scripts_dirs=("$PWD"/scripts "$PWD"/e2e)

cargo clippy -- -Dwarnings
cargo fmt --all -- --check
shellcheck -x "${scripts[@]}"
shfmt -d -i 2 -ci -bn "${scripts_dirs[@]}"
prettier -c $(git ls-files '*.yml' '*.yaml')
markdownlint .
actionlint
