huskies: merge 851

This commit is contained in:
dave
2026-04-29 08:38:00 +00:00
parent 3ce34c34e9
commit 549a9defc4
3 changed files with 163 additions and 4 deletions
+21
View File
@@ -21,6 +21,27 @@ else
echo "Skipping frontend build (no frontend directory)"
fi
echo "=== Checking for duplicate module files (X.rs and X/mod.rs coexisting) ==="
_dup_found=0
while IFS= read -r -d '' _mod_file; do
_dir=$(dirname "$_mod_file")
_parent=$(dirname "$_dir")
_name=$(basename "$_dir")
_flat="$_parent/$_name.rs"
if [ -f "$_flat" ]; then
echo "ERROR [E0761]: duplicate module file — both files exist in the same source tree:"
echo " $_flat"
echo " $_mod_file"
echo " Fix: git rm $_flat in the same commit that introduces $_mod_file"
_dup_found=1
fi
done < <(find "$PROJECT_ROOT/server" "$PROJECT_ROOT/source-map-gen" \
-path "*/target" -prune -o -name "mod.rs" -print0 2>/dev/null)
if [ "$_dup_found" -eq 1 ]; then
echo "FAIL: duplicate module files detected — remove the flat .rs file with git rm before committing."
exit 1
fi
echo "=== Checking Rust formatting ==="
if cargo fmt --version &>/dev/null; then
cargo fmt --manifest-path "$PROJECT_ROOT/Cargo.toml" --all --check