frostfs-api/Makefile

36 lines
812 B
Makefile
Raw Permalink Normal View History

#!/usr/bin/make -f
SHELL=bash
2020-01-30 11:41:24 +00:00
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)"; \
2020-01-30 11:41:24 +00:00
protoc \
--doc_opt=.github/markdown.tmpl,$${f}.md \
--proto_path=.:/usr/local/include \
2020-01-30 11:41:24 +00:00
--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