From 3d7e3cee478b83c8db9fabca80541032d60d3bc0 Mon Sep 17 00:00:00 2001 From: Mads Hougesen Date: Sat, 9 Mar 2024 19:14:24 +0100 Subject: [PATCH] chore: make commands --- Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..9d58a546 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +build: + cargo check + cargo build + cargo build --release + +build-local: + make build + sudo cp target/release/mdsf /usr/local/bin/mdsf-local + +lint: + cargo fmt -- --check --color always + cargo clippy --all-targets --all-features -- -D warnings + +lint-aggressive: + cargo clean + cargo clippy --all-targets --all-features -- -Dclippy::style -Dclippy::double_neg -Dclippy::perf -Dclippy::pedantic -Dclippy::all -Dclippy::cargo -Dclippy::complexity -Dclippy::nursery -Dclippy::suspicious -Aclippy::module_name_repetitions -Aclippy::missing_errors_doc -Aclippy::must_use_candidate -Aclippy::multiple_crate_versions + cargo clean + +test: + make lint + RUST_BACKTRACE=full cargo test --release + +test-coverage: + cargo llvm-cov clean + cargo llvm-cov --all-features --lcov --output-path lcov.info + cargo llvm-cov --open + +precommit: + cargo clean + make build + make lint + make test + cargo run --bin init-schema + npx --yes prettier --write . + git restore tests/markdown.md + typos . + + +publish: + make build + make lint + + cargo clean + cargo publish