trace-forwarder: add make check for Rust

Add make check to run cargo fmt/clippy
for Rust projects.

Fixes: #3656

Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
bin
2022-02-14 16:17:53 +08:00
parent 7ae8901a66
commit 12c37fafc5
5 changed files with 13 additions and 15 deletions

View File

@@ -98,6 +98,8 @@ define INSTALL_FILE
install -D -m 644 $1 $(DESTDIR)$2/$1 || exit 1;
endef
.DEFAULT_GOAL := default
##TARGET default: build code
default: $(TARGET) show-header
@@ -116,17 +118,6 @@ $(GENERATED_FILES): %: %.in
optimize: $(SOURCES) | show-summary show-header
@RUSTFLAGS="-C link-arg=-s $(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES)
##TARGET clippy: run clippy linter
clippy: $(GENERATED_CODE)
cargo clippy --all-targets --all-features --release \
-- \
-Aclippy::redundant_allocation \
-D warnings
format:
cargo fmt -- --check
##TARGET install: install agent
install: install-services
@install -D $(TARGET_PATH) $(DESTDIR)/$(BINDIR)/$(TARGET)
@@ -146,7 +137,7 @@ test:
@cargo test --all --target $(TRIPLE) $(EXTRA_RUSTFEATURES) -- --nocapture
##TARGET check: run test
check: clippy format
check: $(GENERATED_FILES) standard_rust_check
##TARGET run: build and run agent
run: