Buildings and levels for the floor map, and make every identifier searchable
This commit is contained in:
@@ -158,6 +158,32 @@ if [ -n "$CODE_LIB_IMPORTS" ]; then
|
||||
VIOLATIONS=$((VIOLATIONS + 1))
|
||||
fi
|
||||
|
||||
# ADR-017: a marker position is pixels in ONE LEVEL's coordinate space, so a
|
||||
# payload that emits mapx/mapy without levelid gives the consumer coordinates and
|
||||
# no drawing to put them on. The consumer then either renders nothing or - worse,
|
||||
# and what a reasonable implementation does - falls back to the default level,
|
||||
# drawing one building's ground floor behind a marker positioned for another
|
||||
# building's mezzanine. That renders perfectly and points at the wrong place.
|
||||
#
|
||||
# Eight files emit positions across twenty sites. This is the check that says
|
||||
# whether all of them travel with their level, because reading them by eye is
|
||||
# how the twentieth gets missed.
|
||||
echo "==> Checking that emitted map positions carry their level (ADR-017)..."
|
||||
POSITION_FILES=$(grep -rln "'mapx':" --include='*.py' shopdb/ plugins/ 2>/dev/null \
|
||||
| grep -v '/tests\?/' || true)
|
||||
MISSING_LEVEL=""
|
||||
for candidate in $POSITION_FILES; do
|
||||
if ! grep -q "'levelid'" "$candidate"; then
|
||||
MISSING_LEVEL="$MISSING_LEVEL$candidate"$'\n'
|
||||
fi
|
||||
done
|
||||
if [ -n "$MISSING_LEVEL" ]; then
|
||||
echo "FAIL: these emit 'mapx' but never 'levelid' - a position with no level"
|
||||
echo " cannot be rendered on the right drawing:"
|
||||
echo "$MISSING_LEVEL" | sed 's/^/ /'
|
||||
VIOLATIONS=$((VIOLATIONS + 1))
|
||||
fi
|
||||
|
||||
# ENFORCING. It was report-only while the backlog was worked off, and the hit
|
||||
# count then did not move for weeks - a rule that only prints is read as no rule.
|
||||
# Set SITE_LITERALS_ENFORCE=0 to drop back to reporting for a local run.
|
||||
|
||||
Reference in New Issue
Block a user