forked from TrueCloudLab/frostfs-api
Vitaliy Potyarkin
9e29c52e39
This commit is a part of multi-repo cleanup effort: TrueCloudLab/frostfs-infra#136 Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
35 lines
813 B
Makefile
Executable file
35 lines
813 B
Makefile
Executable file
#!/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
|