chore: check-http-adapter-deps guard, README layout
This commit is contained in:
30
Makefile
30
Makefile
@@ -1,6 +1,6 @@
|
||||
.DEFAULT_GOAL := check
|
||||
|
||||
check: fmt-check clippy test test-federation-off check-appcontext check-handler-deps check-handler-repos check-presentation-adapters check-federation-off-social check-binaries-are-thin check-sqlite-is-ap-free
|
||||
check: fmt-check clippy test test-federation-off check-appcontext check-handler-deps check-handler-repos check-http-adapter-deps check-federation-off-social check-binaries-are-thin check-sqlite-is-ap-free
|
||||
@echo "✅ All checks passed"
|
||||
|
||||
check-appcontext:
|
||||
@@ -12,35 +12,35 @@ check-appcontext:
|
||||
@echo "✅ No AppContext in application crate"
|
||||
|
||||
check-handler-deps:
|
||||
@if grep -rnE "[A-Za-z0-9_]*Deps(\s*\{|::from\()" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests | grep -q .; then \
|
||||
echo "❌ hand-built deps struct found in presentation:"; \
|
||||
grep -rnE "[A-Za-z0-9_]*Deps(\s*\{|::from\()" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests; \
|
||||
@if grep -rnE "[A-Za-z0-9_]*Deps(\s*\{|::from\()" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests --exclude=tests.rs | grep -q .; then \
|
||||
echo "❌ hand-built deps struct found in http-axum:"; \
|
||||
grep -rnE "[A-Za-z0-9_]*Deps(\s*\{|::from\()" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests --exclude=tests.rs; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "✅ No hand-built deps structs in presentation"
|
||||
@echo "✅ No hand-built deps structs in http-axum"
|
||||
|
||||
check-handler-repos:
|
||||
@if grep -rn "app_ctx\.repos" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests | grep -q .; then \
|
||||
echo "❌ app_ctx.repos referenced in presentation:"; \
|
||||
grep -rn "app_ctx\.repos" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests; \
|
||||
@if grep -rn "app_ctx\.repos" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests --exclude=tests.rs | grep -q .; then \
|
||||
echo "❌ app_ctx.repos referenced in http-axum:"; \
|
||||
grep -rn "app_ctx\.repos" crates/adapters/http-axum/src --include="*.rs" --exclude-dir=tests --exclude=tests.rs; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "✅ No app_ctx.repos references in presentation"
|
||||
@echo "✅ No app_ctx.repos references in http-axum"
|
||||
|
||||
|
||||
PRESENTATION_ALLOWED_ADAPTERS :=
|
||||
HTTP_ADAPTER_ALLOWED_ADAPTERS :=
|
||||
|
||||
check-presentation-adapters:
|
||||
check-http-adapter-deps:
|
||||
@deps=$$(awk '/^\[dependencies\]/{f=1;next} /^\[/{f=0} f' crates/adapters/http-axum/Cargo.toml \
|
||||
| sed -n 's/^\([A-Za-z0-9_-]\{1,\}\)[[:space:]]*=.*/\1/p'); \
|
||||
bad=""; \
|
||||
for a in $$(ls crates/adapters); do \
|
||||
case " $(PRESENTATION_ALLOWED_ADAPTERS) " in *" $$a "*) continue;; esac; \
|
||||
case " $(HTTP_ADAPTER_ALLOWED_ADAPTERS) " in *" $$a "*) continue;; esac; \
|
||||
if echo "$$deps" | grep -qx "$$a"; then bad="$$bad $$a"; fi; \
|
||||
done; \
|
||||
if [ -n "$$bad" ]; then \
|
||||
echo "❌ presentation depends on adapter crate(s):$$bad"; \
|
||||
echo " presentation may name renderers, not reachers — see ADR-0008."; \
|
||||
echo "❌ http-axum depends on adapter crate(s):$$bad"; \
|
||||
echo " http-axum may name renderers, not reachers — see ADR-0008."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
echo "✅ http-axum depends on no other adapter crate"
|
||||
@@ -129,4 +129,4 @@ dev-spa:
|
||||
spa-dev:
|
||||
@npm --prefix spa run dev
|
||||
|
||||
.PHONY: check fmt fmt-check clippy test test-federation-off fix dev dev-stop dev-worker dev-spa spa-dev check-appcontext check-handler-deps check-handler-repos check-presentation-adapters check-federation-off-social check-binaries-are-thin check-sqlite-is-ap-free
|
||||
.PHONY: check fmt fmt-check clippy test test-federation-off fix dev dev-stop dev-worker dev-spa spa-dev check-appcontext check-handler-deps check-handler-repos check-http-adapter-deps check-federation-off-social check-binaries-are-thin check-sqlite-is-ap-free
|
||||
|
||||
Reference in New Issue
Block a user