Files
managarr/Makefile

49 lines
1.2 KiB
Makefile

#!make
default: run
.PHONY: test test-cov build run lint lint-fix fmt analyze sonar release delete-tag
test:
@cargo test
## Run all tests with coverage - `cargo install cargo-tarpaulin`
test-cov:
@cargo tarpaulin
build: test
@cargo build --release
run:
@CARGO_INCREMENTAL=1 cargo fmt && make lint && cargo run
lint:
@find . | grep '\.\/src\/.*\.rs$$' | xargs touch && cargo clippy --all-targets --workspace
lint-fix:
@cargo fix
fmt:
@cargo fmt
## Analyze for unsafe usage - `cargo install cargo-geiger`
analyze:
@cargo geiger
## Analyze the project with SonarQube - `cargo install cargo-sonar`
# sonar-scanner must be installed and the LastPass CLI must be installed
sonar:
@cargo clippy --message-format json > /tmp/clippy-report.json &&\
cargo sonar --issues clippy --clippy-path /tmp/clippy-report.json --issues-path /tmp/sonar-issues.json &&\
sonar-scanner\
-Dsonar.projectKey=Managarr\
-Dsonar.sources=.\
-Dsonar.externalIssuesReportPaths=/tmp/sonar-issues.json\
-Dsonar.host.url="$$(lpass show --url $$(basename $$(pwd)))"\
-Dsonar.login="$$(lpass show --password $$(basename $$(pwd)))"
release:
@git tag -a ${V} -m "Release ${V}" && git push origin ${V}
delete-tag:
@git tag -d ${V} && git push --delete origin ${V}