diff options
-rwxr-xr-x | check | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -0,0 +1,50 @@ +#!/bin/bash + +set -euo pipefail + +verbose=false +if [ "$#" -gt 0 ] +then + case "$1" in + verbose | -v | --verbose) + verbose=true + shift + ;; + esac +fi + +hideok= +quiet=-q + +if command -v chronic > /dev/null +then + hideok=chronic +fi + +if $verbose +then + quiet= + hideok= +fi + +$hideok cargo check --all-targets +if cargo --list | grep 'clippy$' > /dev/null +then + cargo clippy $quiet +fi +$hideok cargo build --all-targets +$hideok cargo test $quiet +$hideok cargo fmt -- --check + +if command -v black > /dev/null +then + $hideok find . -type f -name '*.py' ! -name test.py -exec black --check '{}' + +fi + +sp-docgen contractor.md -o contractor.html +sp-docgen contractor.md -o contractor.pdf +sp-codegen contractor.md -o test.py +rm -f test.log +$hideok python3 test.py --log test.log "$@" + +echo "Everything seems to be in order." |