Files
rust_browser/scripts/check_file_size.sh
Zachary D. Rowitsch e589101a2e Refactor rasterizer/tests.rs into focused submodules
Split the 2,246-line monolithic test file (82 tests) into 8 focused
submodules under tests/: pixel_buffer, fill_rect, border, border_style,
text, image, box_shadow, and display_list tests.

Also harden CI scripts (check_file_size.sh, check_unsafe.sh, metrics.sh)
to skip deleted-but-unstaged files when iterating git ls-files output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:51:21 -05:00

22 lines
445 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
MAX_LINES=2000
warned=0
while IFS= read -r f; do
[[ -f "$f" ]] || continue
lines=$(wc -l < "$f")
if [[ $lines -gt $MAX_LINES ]]; then
echo "WARNING: $f has $lines lines (max recommended: $MAX_LINES)"
warned=1
fi
done < <(git ls-files '*.rs')
if [[ $warned -ne 0 ]]; then
echo
echo "Consider breaking up large files to improve maintainability."
fi
echo "OK: file size check complete"