#!/usr/bin/make -f SHELL=bash include help.mk .PHONY: doc fmt pre-commit unpre-commit pre-commit-run # Regenerate documentation for proto files: doc: @for f in `find . -type f -name '*.proto' -exec dirname {} \; | sort -u `; do \ echo "⇒ Documentation for $$(basename $$f)"; \ protoc \ --doc_opt=.forgejo/markdown.tmpl,$${f}.md \ --proto_path=.:/usr/local/include \ --doc_out=proto-docs/ $${f}/*.proto; \ done # Run clang-format fmt: @for f in `ls **/*.proto`; do \ echo "⇒ Formatting $$f"; \ clang-format -i $$f; \ done # Activate pre-commit hooks pre-commit: pre-commit install --hook-type pre-commit # Deactivate pre-commit hooks unpre-commit: pre-commit uninstall --hook-type pre-commit # Run pre-commit hooks pre-commit-run: @pre-commit run --all-files --hook-stage manual