Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL := /bin/bash

.PHONY: precommit
precommit: check-links check-json
precommit: check-links check-json check-index

.PHONY: release-check
release-check: precommit check-versions
Expand All @@ -26,3 +26,15 @@ check-versions:
build-index:
@python3 scripts/build-index.py > rules/index.json
@echo "rules/index.json updated"

.PHONY: check-index
check-index:
@python3 scripts/build-index.py > /tmp/coding-rules-index-check.json
@if ! diff -q rules/index.json /tmp/coding-rules-index-check.json > /dev/null 2>&1; then \
echo "ERROR: rules/index.json is stale. Run 'make build-index' and commit the result."; \
diff -u rules/index.json /tmp/coding-rules-index-check.json | head -40; \
rm -f /tmp/coding-rules-index-check.json; \
exit 1; \
fi
@rm -f /tmp/coding-rules-index-check.json
@echo "rules/index.json up-to-date"
Loading