From 5e1fec72433ca6ebe9d55609cfe121a017febd4a Mon Sep 17 00:00:00 2001 From: Tom Dohrmann Date: Sat, 28 Dec 2024 08:21:26 +0000 Subject: [PATCH] add clippy target to Makefile This makes it easier to run the same clippy checks that CI uses. --- .github/workflows/build.yml | 11 ++--------- Makefile | 7 ++++++- common/Makefile | 5 ++++- host/Makefile | 5 ++++- tee/Makefile | 6 +++++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d9f550d..dd7b6a31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,15 +103,8 @@ jobs: common host tee - - name: "Check common" - run: cargo clippy --workspace -- -D warnings - working-directory: common - - name: "Check host" - run: cargo clippy --workspace -- -D warnings - working-directory: host - - name: "Check tee" - run: cargo clippy --workspace --exclude example -- -D warnings - working-directory: tee + - name: "Check" + run: make clippy test-linux: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 71c5bf6f..8ea09b60 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,14 @@ endif run-example: all $(MAKE) -C tee/example run +clippy: + $(MAKE) -C common clippy + $(MAKE) -C host clippy + $(MAKE) -C tee clippy + clean: $(MAKE) -C common clean $(MAKE) -C host clean $(MAKE) -C tee clean -.PHONY: all kernel supervisor-snp supervisor-tdx cli test run verify run-example clean +.PHONY: all kernel supervisor-snp supervisor-tdx cli test run verify run-example clippy clean diff --git a/common/Makefile b/common/Makefile index dda4c186..f8b6f962 100644 --- a/common/Makefile +++ b/common/Makefile @@ -1,6 +1,9 @@ default: +clippy: + cargo clippy --workspace -- -D warnings + clean: cargo clean -.PHONY: default clean +.PHONY: default clippy clean diff --git a/host/Makefile b/host/Makefile index dda4c186..f8b6f962 100644 --- a/host/Makefile +++ b/host/Makefile @@ -1,6 +1,9 @@ default: +clippy: + cargo clippy --workspace -- -D warnings + clean: cargo clean -.PHONY: default clean +.PHONY: default clippy clean diff --git a/tee/Makefile b/tee/Makefile index 5678ebde..e096c9dc 100644 --- a/tee/Makefile +++ b/tee/Makefile @@ -1,7 +1,11 @@ default: +clippy: + cargo clippy --workspace --exclude example -- -D warnings + cargo clippy -p example -- -D warnings + clean: cargo clean $(MAKE) -C example clean -.PHONY: default clean +.PHONY: default clippy clean