2023-04-19 17:39:39 +03:00
|
|
|
.POSIX:
|
2023-04-20 20:19:11 +03:00
|
|
|
.SUFFIXES:
|
2023-06-09 16:34:23 +03:00
|
|
|
CARGOBIN = cargo
|
|
|
|
CARGOSORTBIN = cargo-sort
|
|
|
|
DJHTMLBIN = djhtml
|
|
|
|
BLACKBIN = black
|
|
|
|
PRINTF = /usr/bin/printf
|
2023-04-20 20:19:11 +03:00
|
|
|
|
2024-02-13 09:48:54 +02:00
|
|
|
HTML_FILES := $(shell find mailpot-web/src/templates -type f -print0 | tr '\0' ' ')
|
2023-06-09 16:34:23 +03:00
|
|
|
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:
|
2023-06-09 16:34:23 +03:00
|
|
|
@$(CARGOBIN) check --all-features --all --tests --examples --benches --bins
|
2022-08-24 12:22:44 +03:00
|
|
|
|
|
|
|
.PHONY: fmt
|
|
|
|
fmt:
|
2023-06-09 16:34:23 +03:00
|
|
|
@$(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:
|
2023-06-09 16:34:23 +03:00
|
|
|
@$(CARGOBIN) clippy --no-deps --all-features --all --tests --examples --benches --bins
|
2023-04-18 14:45:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
.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:
|
2023-06-09 16:34:23 +03:00
|
|
|
@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:
|
2023-06-09 16:34:23 +03:00
|
|
|
@RUSTDOCFLAGS="--html-before-content ./.github/doc_extra.html" $(CARGOBIN) doc --workspace --all-features --no-deps --document-private-items --open
|
2023-06-18 12:43:23 +03:00
|
|
|
|
|
|
|
.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
|