From ad2bda20d1c961702a24b2170405c7a911e0916b Mon Sep 17 00:00:00 2001 From: aalu1418 <50029043+aalu1418@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:10:54 -0600 Subject: [PATCH] add formatter to CI + makefile --- .github/workflows/rust.yml | 9 ++++++--- Makefile | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5871622b8..f7025df27 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -117,6 +117,9 @@ jobs: cd /repo/contracts &&\ cargo check &&\ cargo clippy -- -D warnings" - - # - run: cargo check - # - run: cargo clippy -- -D warnings + - name: format + run: | + yarn install --frozen-lockfile + cd ../ # back to root + make format-contracts + git diff --stat --exit-code diff --git a/Makefile b/Makefile index f2f2079ae..06e3b0077 100644 --- a/Makefile +++ b/Makefile @@ -127,3 +127,7 @@ upgrade-e2e-solana-image: .PHONY: update-e2e-core-deps upgrade-e2e-core-deps: cd ./integration-tests && ../scripts/update-e2e.sh + +.PHONY: format-contracts +format-contracts: + cd ./contracts && cargo fmt && go fmt ./... && yarn format