From fa2aff76f6f45333a2ba9ab5a114ff2fc3d2ddf5 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 6 Sep 2025 09:47:12 -0700 Subject: [PATCH] Standardize formatting of shell code in tasks and workflows Shell scripts in Arduino tooling projects are formatted according to the style implemented by the shfmt formatting tool. In addition to standalone script files, significant quantities of complex shell code is also found in the asset tasks and workflows. shfmt can not be used to format this code (both due to the fact it is in the form of strings in YAML documents, and due to the fact that it is actually templates of shell code (making use of the templating features of Task and GitHub Actions) rather than complete shell code). However, it still makes sense to align the formatting of this code with the standardized shell code style where doing so is feasible. --- .github/workflows/check-general-formatting-task.yml | 6 +++--- .github/workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/check-go-task.yml | 2 +- .github/workflows/check-license.yml | 2 +- .github/workflows/check-markdown-task.yml | 2 +- .github/workflows/check-npm-task.yml | 2 +- .github/workflows/check-poetry-task.yml | 2 +- .github/workflows/check-prettier-formatting-task.yml | 2 +- .github/workflows/check-taskfiles.yml | 2 +- .github/workflows/check-yaml-task.yml | 2 +- .github/workflows/release-go-crosscompile-task.yml | 10 +++++----- .github/workflows/spell-check-task.yml | 2 +- .github/workflows/sync-labels-npm.yml | 6 +++--- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/check-general-formatting-task.yml b/.github/workflows/check-general-formatting-task.yml index 48424f0..ee3137e 100644 --- a/.github/workflows/check-general-formatting-task.yml +++ b/.github/workflows/check-general-formatting-task.yml @@ -35,7 +35,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT check: needs: run-determination @@ -48,7 +48,7 @@ jobs: - name: Set environment variables run: | # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable - echo "EC_INSTALL_PATH=${{ runner.temp }}/editorconfig-checker" >> "$GITHUB_ENV" + echo "EC_INSTALL_PATH=${{ runner.temp }}/editorconfig-checker" >>"$GITHUB_ENV" - name: Checkout repository uses: actions/checkout@v5 @@ -80,7 +80,7 @@ jobs: "${{ env.EC_INSTALL_PATH }}/bin/ec" # Add installation to PATH: # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path - echo "${{ env.EC_INSTALL_PATH }}/bin" >> "$GITHUB_PATH" + echo "${{ env.EC_INSTALL_PATH }}/bin" >>"$GITHUB_PATH" - name: Check formatting run: | diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 0aeb414..369d775 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -53,7 +53,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT check-cache: needs: run-determination diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index 475d87d..9d29ff1 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -47,7 +47,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT check-errors: name: check-errors (${{ matrix.module.path }}) diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml index 5ecb9b1..0c9d798 100644 --- a/.github/workflows/check-license.yml +++ b/.github/workflows/check-license.yml @@ -50,7 +50,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT check-license: name: ${{ matrix.check-license.path }} diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index 59f6c7f..1c7f128 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -59,7 +59,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT lint: needs: run-determination diff --git a/.github/workflows/check-npm-task.yml b/.github/workflows/check-npm-task.yml index 5ab621d..7e1167b 100644 --- a/.github/workflows/check-npm-task.yml +++ b/.github/workflows/check-npm-task.yml @@ -47,7 +47,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT validate: name: validate (${{ matrix.project.path }}) diff --git a/.github/workflows/check-poetry-task.yml b/.github/workflows/check-poetry-task.yml index ad7fc11..bb532c2 100644 --- a/.github/workflows/check-poetry-task.yml +++ b/.github/workflows/check-poetry-task.yml @@ -43,7 +43,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT validate: needs: run-determination diff --git a/.github/workflows/check-prettier-formatting-task.yml b/.github/workflows/check-prettier-formatting-task.yml index 163b58c..6dec824 100644 --- a/.github/workflows/check-prettier-formatting-task.yml +++ b/.github/workflows/check-prettier-formatting-task.yml @@ -243,7 +243,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT check: needs: run-determination diff --git a/.github/workflows/check-taskfiles.yml b/.github/workflows/check-taskfiles.yml index b91bbc3..ffbdeb9 100644 --- a/.github/workflows/check-taskfiles.yml +++ b/.github/workflows/check-taskfiles.yml @@ -49,7 +49,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT validate: name: Validate ${{ matrix.file }} diff --git a/.github/workflows/check-yaml-task.yml b/.github/workflows/check-yaml-task.yml index 3ab9044..b0d585c 100644 --- a/.github/workflows/check-yaml-task.yml +++ b/.github/workflows/check-yaml-task.yml @@ -65,7 +65,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT check: name: ${{ matrix.configuration.name }} diff --git a/.github/workflows/release-go-crosscompile-task.yml b/.github/workflows/release-go-crosscompile-task.yml index 595bcb7..7a50501 100644 --- a/.github/workflows/release-go-crosscompile-task.yml +++ b/.github/workflows/release-go-crosscompile-task.yml @@ -104,9 +104,9 @@ jobs: - name: Set environment variables run: | # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable - echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV" + echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >>"$GITHUB_ENV" TAG="${GITHUB_REF/refs\/tags\//}" - echo "PACKAGE_FILENAME=${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" >> $GITHUB_ENV + echo "PACKAGE_FILENAME=${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" >>$GITHUB_ENV - name: Checkout repository uses: actions/checkout@v5 @@ -124,7 +124,7 @@ jobs: # Arbitrary password for a keychain that exists only for the duration of the job, so not secret KEYCHAIN_PASSWORD: keychainpassword run: | - echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}" + echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode >"${{ env.INSTALLER_CERT_MAC_PATH }}" security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" security default-keychain -s "${{ env.KEYCHAIN }}" security unlock-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" @@ -149,7 +149,7 @@ jobs: - name: Write gon config to file # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) run: | - cat > "${{ env.GON_CONFIG_PATH }}" <"${{ env.GON_CONFIG_PATH }}" < ${TAG}-checksums.txt + sha256sum ${{ env.PROJECT_NAME }}_${TAG}* >${TAG}-checksums.txt - name: Identify Prerelease # This is a workaround while waiting for create-release action diff --git a/.github/workflows/spell-check-task.yml b/.github/workflows/spell-check-task.yml index 7b6a601..1a12458 100644 --- a/.github/workflows/spell-check-task.yml +++ b/.github/workflows/spell-check-task.yml @@ -35,7 +35,7 @@ jobs: RESULT="false" fi - echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "result=$RESULT" >>$GITHUB_OUTPUT spellcheck: needs: run-determination diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels-npm.yml index 8e459f5..210b450 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels-npm.yml @@ -101,7 +101,7 @@ jobs: - name: Set environment variables run: | # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable - echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" + echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >>"$GITHUB_ENV" - name: Determine whether to dry run id: dry-run @@ -117,7 +117,7 @@ jobs: run: | # Use of this flag in the github-label-sync command will cause it to only check the validity of the # configuration. - echo "flag=--dry-run" >> $GITHUB_OUTPUT + echo "flag=--dry-run" >>$GITHUB_OUTPUT - name: Checkout repository uses: actions/checkout@v5 @@ -143,7 +143,7 @@ jobs: run: | # Merge all configuration files shopt -s extglob - cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" + cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) >"${{ env.MERGED_CONFIGURATION_PATH }}" - name: Install github-label-sync run: npm install