From 3ca2996e43b257c46aa1efc5c2b1b7c0199b8b4f Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Wed, 31 Jan 2024 23:12:08 -0500 Subject: [PATCH] refactor(ci): use gofmt directly, mark shell scripts clearly --- .github/workflows/ci.yaml | 4 ++-- ...nstall_specific_version => install_specific_version.sh} | 0 scripts/build => script/build.sh | 0 script/format.sh | 7 +++++++ scripts/test => script/test.sh | 0 scripts/format | 3 --- 6 files changed, 9 insertions(+), 5 deletions(-) rename integration/{install_specific_version => install_specific_version.sh} (100%) rename scripts/build => script/build.sh (100%) create mode 100644 script/format.sh rename scripts/test => script/test.sh (100%) delete mode 100644 scripts/format diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e850cda..1661ace 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - - run: . scripts/test + - run: . script/test.sh integration-tests: name: "Integration tests" runs-on: ubuntu-latest @@ -29,4 +29,4 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - - run: . integration/install_specific_version + - run: . integration/install_specific_version.sh diff --git a/integration/install_specific_version b/integration/install_specific_version.sh similarity index 100% rename from integration/install_specific_version rename to integration/install_specific_version.sh diff --git a/scripts/build b/script/build.sh similarity index 100% rename from scripts/build rename to script/build.sh diff --git a/script/format.sh b/script/format.sh new file mode 100644 index 0000000..fac9ac0 --- /dev/null +++ b/script/format.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +if [[ -z "$FIX" ]]; then + [ -z "$(gofmt -s -l ./)" ] || exit 1 +else + gofmt -s -l -w ./ +fi diff --git a/scripts/test b/script/test.sh similarity index 100% rename from scripts/test rename to script/test.sh diff --git a/scripts/format b/scripts/format deleted file mode 100644 index bc2d5e5..0000000 --- a/scripts/format +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/bash - -go fmt ./...