From d795ef36a04199d97e5e82d1be9f962d3c6b26fb Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Fri, 2 Aug 2024 18:56:30 +0200 Subject: [PATCH 1/2] Fix issues in cabal-gild check --- .github/workflows/check-cabal-gild.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-cabal-gild.yml b/.github/workflows/check-cabal-gild.yml index 3acfff8cd0..d8aa1c10d0 100644 --- a/.github/workflows/check-cabal-gild.yml +++ b/.github/workflows/check-cabal-gild.yml @@ -9,22 +9,22 @@ jobs: runs-on: ubuntu-latest env: - CARDANO_GUILD_VERSION: "1.3.1.2" + CABAL_GILD_VERSION: "1.3.1.2" steps: - - name: Download cardano-gild + - name: Download cabal-gild run: | - cardano_gild_path="$(mktemp -d)" - version="${{env.CARDANO_GUILD_VERSION}}" + cabal_gild_path="$(mktemp -d)" + version="${{env.CABAL_GILD_VERSION}}" curl -sL \ "https://github.com/tfausak/cabal-gild/releases/download/$version/cabal-gild-$version-linux-x64.tar.gz" \ - | tar -C "$cardano_gild_path" -xz + | tar -C "$cabal_gild_path" -xz - echo "PATH=$cardano_gild_path:$PATH" >> "$GITHUB_ENV" + echo "PATH=$cabal_gild_path:$PATH" >> "$GITHUB_ENV" - uses: actions/checkout@v4 - - name: Run cardano-gild over all modified files + - name: Run cabal-gild over all modified files run: | rc="0" @@ -33,8 +33,13 @@ jobs: echo "cabal-gild --mode=check --input=$file" if ! cabal-gild --mode=check --input="$file" then + cabal-gild --mode=format --io="$file" echo "💣 $file is badly formatted. Fix it with:" echo "cabal-gild --mode=format --io=$file" + echo -e + echo "Diff for $file:" + git diff "$file" + echo -e rc="1" fi done From 3462e0f7a68278a9ebd115d8b0e416746de9c094 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 5 Aug 2024 17:58:09 +0200 Subject: [PATCH 2/2] Echo version of cabal-gild in GitHub action --- .github/workflows/check-cabal-gild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-cabal-gild.yml b/.github/workflows/check-cabal-gild.yml index d8aa1c10d0..569aa9e1ea 100644 --- a/.github/workflows/check-cabal-gild.yml +++ b/.github/workflows/check-cabal-gild.yml @@ -27,7 +27,7 @@ jobs: - name: Run cabal-gild over all modified files run: | rc="0" - + echo "cabal-gild version: ${{env.CABAL_GILD_VERSION}}" for file in $(git ls-files "*.cabal") do echo "cabal-gild --mode=check --input=$file"