37 lines
1.1 KiB
Shell
37 lines
1.1 KiB
Shell
|
|
#!/usr/bin/env bash
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
cd "$(dirname "$0")/.."
|
||
|
|
|
||
|
|
for module in \
|
||
|
|
src/Nuthatch/Http/Server.hs \
|
||
|
|
src/Nuthatch/Http/Auth.hs \
|
||
|
|
src/Nuthatch/Browse.hs \
|
||
|
|
src/Nuthatch/Transfer.hs \
|
||
|
|
src/Nuthatch/Mutation/Service.hs \
|
||
|
|
src/Nuthatch/Mutation/Recovery.hs \
|
||
|
|
src/Nuthatch/Mutation/Effects.hs; do
|
||
|
|
test -f "$module"
|
||
|
|
done
|
||
|
|
|
||
|
|
test "$(wc -l <src/Nuthatch/App.hs)" -le 40
|
||
|
|
|
||
|
|
if grep -Eq 'Servant|Nuthatch\.Http' \
|
||
|
|
src/Nuthatch/Mutation/Service.hs \
|
||
|
|
src/Nuthatch/Mutation/Recovery.hs \
|
||
|
|
src/Nuthatch/Mutation/Effects.hs; then
|
||
|
|
printf '%s\n' "Mutation protocol services depend on HTTP" >&2
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
grep -F 'Nuthatch.Mutation.Service' src/Nuthatch/Transfer.hs >/dev/null
|
||
|
|
grep -F 'Nuthatch.Mutation.Service' src/Nuthatch/Http/Server.hs >/dev/null
|
||
|
|
grep -F 'Nuthatch.Mutation.Service' src/Nuthatch/Mutation/Recovery.hs >/dev/null
|
||
|
|
|
||
|
|
if grep -Eq 'recoverOnce|recoverOne|finalizeRecovered|observeObjectWithRetry' \
|
||
|
|
src/Nuthatch/App.hs src/Nuthatch/Http/*.hs; then
|
||
|
|
printf '%s\n' "Recovery implementation leaked into HTTP composition" >&2
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
printf '%s\n' "Application responsibility boundaries passed"
|