Skip to content

Commit 40416bf

Browse files
author
Bob Strahan
committed
Optimize UI lint with checksum caching and fix typo in typecheck comment
1 parent 8955336 commit 40416bf

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,25 @@ typecheck-stats:
103103
basedpyright --stats
104104

105105
# Type check only files changed in current PR/branch
106-
# Usage: make typecheck-pr [TARGET_BRANCH=branch_name]
106+
# Usage: make typecheck-pr [TARGET_BRANCH=branch_name]u
107107
TARGET_BRANCH ?= main
108108
typecheck-pr:
109109
@echo "Type checking changed files against $(TARGET_BRANCH)..."
110110
python3 scripts/typecheck_pr_changes.py $(TARGET_BRANCH)
111111

112112

113113
ui-lint:
114-
@echo "Checking UI lint"
115-
cd src/ui && npm ci --prefer-offline --no-audit && npm run lint
114+
@echo "Checking if UI lint is needed..."
115+
@CURRENT_HASH=$$(python3 -c "from publish import IDPPublisher; p = IDPPublisher(); print(p.get_directory_checksum('src/ui'))"); \
116+
STORED_HASH=$$(test -f src/ui/.checksum && cat src/ui/.checksum || echo ""); \
117+
if [ "$$CURRENT_HASH" != "$$STORED_HASH" ]; then \
118+
echo "UI code checksum changed - running lint..."; \
119+
cd src/ui && npm ci --prefer-offline --no-audit && npm run lint && \
120+
echo "$$CURRENT_HASH" > .checksum; \
121+
echo -e "$(GREEN)✅ UI lint completed and checksum updated$(NC)"; \
122+
else \
123+
echo -e "$(GREEN)✅ UI code checksum unchanged - skipping lint$(NC)"; \
124+
fi
116125

117126
ui-build:
118127
@echo "Checking UI build"
@@ -130,4 +139,4 @@ fastcommit: fastlint
130139
export COMMIT_MESSAGE="$(shell q chat --no-interactive --trust-all-tools "Understand pending local git change and changes to be committed, then infer a commit message. Return this commit message only" | tail -n 1 | sed 's/\x1b\[[0-9;]*m//g')" && \
131140
git add . && \
132141
git commit -am "$${COMMIT_MESSAGE}" && \
133-
git push
142+
git push

0 commit comments

Comments
 (0)