Source commit: 6d1a121b0a8a636aac95998fe5d15c24c78eb7d0 Public tree identity: sha256:2bc22807f5b838286678b65d3f550b8ae4714ae673622041d4c2516a7c5b7926
23 lines
622 B
Bash
Executable file
23 lines
622 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$repo_root"
|
|
|
|
maximum_lines=3000
|
|
failed=0
|
|
while IFS= read -r -d '' file; do
|
|
case "$file" in
|
|
*/tests.rs|*/tests/*) continue ;;
|
|
esac
|
|
lines="$(wc -l < "$file")"
|
|
if ((lines > maximum_lines)); then
|
|
printf '%s has %s lines; production file limit is %s\n' "$file" "$lines" "$maximum_lines" >&2
|
|
failed=1
|
|
fi
|
|
done < <(find crates private/hosted-policy/src -type f -name '*.rs' -print0)
|
|
|
|
if ((failed)); then
|
|
exit 1
|
|
fi
|
|
printf 'production source file size guard passed (%s lines maximum)\n' "$maximum_lines"
|