mailpot/Makefile

47 lines
1.8 KiB
Makefile
Raw Permalink Normal View History

2023-04-19 17:39:39 +03:00
.POSIX:
.SUFFIXES:
CARGOBIN = cargo
CARGOSORTBIN = cargo-sort
DJHTMLBIN = djhtml
BLACKBIN = black
PRINTF = /usr/bin/printf
HTML_FILES := $(shell find mailpot-web/src/templates -type f -print0 | tr '\0' ' ')
PY_FILES := $(shell find . -type f -name '*.py' -print0 | tr '\0' ' ')
2023-04-19 17:39:39 +03:00
2022-08-24 12:22:44 +03:00
.PHONY: check
check:
@$(CARGOBIN) check --all-features --all --tests --examples --benches --bins
2022-08-24 12:22:44 +03:00
.PHONY: fmt
fmt:
@$(CARGOBIN) +nightly fmt --all || $(CARGOBIN) fmt --all
@OUT=$$($(CARGOSORTBIN) -w 2>&1) || $(PRINTF) "ERROR: %s cargo-sort failed or binary not found in PATH.\n" "$$OUT"
@OUT=$$($(DJHTMLBIN) $(HTML_FILES) 2>&1) || $(PRINTF) "ERROR: %s djhtml failed or binary not found in PATH.\n" "$$OUT"
@OUT=$$($(BLACKBIN) -q $(PY_FILES) 2>&1) || $(PRINTF) "ERROR: %s black failed or binary not found in PATH.\n" "$$OUT"
2022-08-24 12:22:44 +03:00
.PHONY: lint
lint:
@$(CARGOBIN) clippy --no-deps --all-features --all --tests --examples --benches --bins
.PHONY: test
test: check lint
2023-07-29 10:59:29 +03:00
@$(CARGOBIN) nextest run --all --no-fail-fast --all-features
2023-04-25 17:02:24 +03:00
.PHONY: rustdoc
rustdoc:
@RUSTDOCFLAGS="--html-before-content ./.github/doc_extra.html" $(CARGOBIN) doc --workspace --all-features --no-deps --document-private-items
2023-05-05 16:58:48 +03:00
.PHONY: rustdoc-open
rustdoc-open:
@RUSTDOCFLAGS="--html-before-content ./.github/doc_extra.html" $(CARGOBIN) doc --workspace --all-features --no-deps --document-private-items --open
.PHONY: rustdoc-nightly
rustdoc-nightly:
@RUSTDOCFLAGS="--html-before-content ./.github/doc_extra.html" $(CARGOBIN) +nightly doc -Zrustdoc-map -Z rustdoc-scrape-examples --workspace --all-features --no-deps --document-private-items
.PHONY: rustdoc-nightly-open
rustdoc-nightly-open:
@RUSTDOCFLAGS="--html-before-content ./.github/doc_extra.html" $(CARGOBIN) +nightly doc -Zrustdoc-map -Z rustdoc-scrape-examples --workspace --all-features --no-deps --document-private-items --open