From 6b7bdd409163773ddc771736feb99a805334696a Mon Sep 17 00:00:00 2001 From: aalu1418 <50029043+aalu1418@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:17:15 -0600 Subject: [PATCH] add formatter to CI + makefile --- .github/workflows/rust.yml | 10 +++++++--- Makefile | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5871622b8..6a9a7eef0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -105,6 +105,13 @@ jobs: with: path: contracts/target key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - name: format (cargo, go, yarn) + run: | + yarn install --frozen-lockfile + cd ../ # back to root + make format-contracts + git diff --stat --exit-code - name: cargo check env: @@ -117,6 +124,3 @@ jobs: cd /repo/contracts &&\ cargo check &&\ cargo clippy -- -D warnings" - - # - run: cargo check - # - run: cargo clippy -- -D warnings 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