45 lines
1.1 KiB
Makefile
45 lines
1.1 KiB
Makefile
default: run
|
|
|
|
test:
|
|
@cargo test
|
|
|
|
## Run all tests with coverage - `cargo install cargo-tarpaulin`
|
|
test-cov:
|
|
@cargo tarpaulin
|
|
|
|
build:
|
|
@make 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 LastPass
|
|
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}
|