Makefile 697 B

12345678910111213141516171819202122232425262728293031
  1. .PHONY: check check-fmt check-test check-clippy check-lines
  2. # Run all quality gates
  3. check: check-fmt check-test check-clippy check-lines
  4. check-fmt:
  5. cargo fmt --check
  6. check-test:
  7. cargo test
  8. check-clippy:
  9. cargo clippy --all-targets -- -D warnings
  10. # Ensure no Rust source file exceeds 500 lines
  11. check-lines:
  12. @exit_code=0; \
  13. max=500; \
  14. for f in src/**/*.rs src/*.rs; do \
  15. [ -f "$$f" ] || continue; \
  16. lines=$$(wc -l < "$$f"); \
  17. if [ "$$lines" -gt "$$max" ]; then \
  18. echo "FAIL: $$f has $$lines lines (max $$max)"; \
  19. exit_code=1; \
  20. fi; \
  21. done; \
  22. if [ "$$exit_code" -eq 0 ]; then \
  23. echo "✅ All Rust source files are under $$max lines"; \
  24. else \
  25. exit "$$exit_code"; \
  26. fi