#!/bin/bash

# SPDX-FileCopyrightText: 2021 Robin Vobruba <hoijui.quaero@gmail.com>
#
# SPDX-License-Identifier: Unlicense

# Exit immediately on each error and unset variable;
# see: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -Eeuo pipefail
#set -Eeu

script_dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")

cargo test
cargo fmt -- --check
cargo clippy -- --deny clippy::pedantic --allow clippy::ptr_arg # HACK We disable this check, as clippy falsely thinks Dict's could be replaced by Vec's
if which reuse
then
  reuse lint
else
  echo "WARNING: REUSE tool not found; skipping licensing check."
fi
