.PHONY: ci verify clippy tarpaulin sloc sloc-strict clean_tmp test fmt
SHELL := /bin/bash
.SHELLFLAGS := -o pipefail -c
ifeq ($(OS),Windows_NT)
TMP_DIR := $(shell pwd -W)/.tmp
else
TMP_DIR := $(CURDIR)/.tmp
endif
TEMP_ENV := TEMP="$(TMP_DIR)" TMP="$(TMP_DIR)"
ci:
@mkdir -p .tmp
@set -o pipefail && $(TEMP_ENV) cargo tarpaulin --config tarpaulin.toml 2>&1 | tail -n 30
@cargo clippy --all-targets --all-features -q -- -D warnings
@$(TEMP_ENV) sloc-guard -q check
verify: tarpaulin clippy sloc fmt
clippy:
cargo clippy --all-targets --all-features -- -D warnings
tarpaulin:
mkdir -p .tmp
$(TEMP_ENV) cargo tarpaulin --config tarpaulin.toml
clean_tmp:
rm -rf .tmp
sloc:
mkdir -p .tmp
$(TEMP_ENV) sloc-guard check
test:
cargo test
fmt:
cargo fmt --all