Public release release-be1f654ae8de
Source commit: be1f654ae8de7d5eeb2005b4e1a05bf1ebf3124f Public tree identity: sha256:ab53679496be4be7d1e02bc00723072774d1a3f87e10cc56558a752f28f6abb1
This commit is contained in:
commit
a6ca9e26dd
210 changed files with 78671 additions and 0 deletions
23
scripts/check-code-size.sh
Executable file
23
scripts/check-code-size.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue