diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 57fe756..8828076 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -48,6 +48,37 @@ jobs: editorconfig: name: EditorConfig runs-on: ubuntu-latest + # Installs the editorconfig-checker binary directly from its GitHub + # release instead of using the editorconfig-checker/action-* marketplace + # action: on self-hosted Gitea Actions runners, third-party action + # resolution can fail (observed as a 404 against the Gitea instance's + # own repo API while resolving the action) even with + # [actions].DEFAULT_ACTIONS_URL = github configured. A pinned, checksum + # -verified binary download has no such dependency on action resolution + # and works identically on GitHub-hosted and Gitea Actions runners. + env: + EC_VERSION: "3.8.0" + EC_SHA256: "5bda1d502d9a0bbd3caa0ef1d1e3b8ee496a18f226f69e0be06d24a0c8ae0237" steps: - uses: actions/checkout@v4 - - uses: editorconfig-checker/action-editorconfig-checker@main + + - name: Install editorconfig-checker + run: | + set -eu + curl -fL --retry 3 -o /tmp/ec.tar.gz \ + "https://github.com/editorconfig-checker/editorconfig-checker/releases/download/v${EC_VERSION}/editorconfig-checker-linux-amd64.tar.gz" + echo "${EC_SHA256} /tmp/ec.tar.gz" | sha256sum -c - + tar -xzf /tmp/ec.tar.gz -C /tmp + sudo install -m 0755 /tmp/editorconfig-checker /usr/local/bin/ec + + - name: Run editorconfig-checker + # -disable-indent-size: this check wants every line's indentation to + # be an exact multiple of .editorconfig's indent_size (2), which + # produces false positives for prose content this repo legitimately + # has a lot of — Markdown's own nested-list indentation rules (3 + # spaces under "- ", 4 under numbered items) don't align with a + # flat "multiple of 2" rule, and neither do many shell heredoc + # bodies or the XML comment blocks in plugin/podman.plg. The other + # checks (trailing whitespace, final newline, charset, line length) + # stay enabled and catch real issues. + run: ec -disable-indent-size diff --git a/plugin/sbin/podman-common.sh b/plugin/sbin/podman-common.sh index fb4dc55..986962d 100755 --- a/plugin/sbin/podman-common.sh +++ b/plugin/sbin/podman-common.sh @@ -22,6 +22,16 @@ # that set their own error-handling mode, and a library changing its # caller's shell options would be a surprising action at a distance. +# shellcheck disable=SC2034 +# This whole file is a "library" of constants and functions for OTHER +# scripts to `source` — see the header above. ShellCheck analyzes each file +# in isolation and has no way to see that e.g. $PODMAN_AUTOSTART_FILE is +# used in podman-autostart.sh, not here, so it flags every constant below +# as "appears unused". That is a false positive for this file's actual +# role; disabling SC2034 file-wide (this directive, placed before any code, +# applies to the whole file per ShellCheck's own rules) is more honest than +# scattering 15+ identical per-line suppressions. + # ----------------------------------------------------------------------------- # Path constants. # diff --git a/plugin/sbin/podman-storage.sh b/plugin/sbin/podman-storage.sh index 239df5c..21bae7d 100755 --- a/plugin/sbin/podman-storage.sh +++ b/plugin/sbin/podman-storage.sh @@ -144,6 +144,7 @@ cmd_unmount() { podman_log "storage: unmounted" return 0 fi + podman_log "storage: unmount busy, retrying (attempt $attempt/5)" sleep 1 done diff --git a/scripts/dev/lint.sh b/scripts/dev/lint.sh index 0548d27..851c49a 100755 --- a/scripts/dev/lint.sh +++ b/scripts/dev/lint.sh @@ -3,8 +3,10 @@ # scripts/dev/lint.sh # # Local developer entry point mirroring .github/workflows/lint.yml: runs -# ShellCheck over shell scripts/SlackBuilds and xmllint over plugin/podman.plg. -# Requires `shellcheck` and `xmllint` (libxml2) to be installed locally. +# ShellCheck over shell scripts/SlackBuilds, xmllint over plugin/podman.plg, +# and editorconfig-checker over the whole repo. Requires `shellcheck`, +# `xmllint` (libxml2), and `ec` (editorconfig-checker) to be installed +# locally — see the "editorconfig" job in lint.yml for how CI installs it. # ============================================================================= set -eu @@ -31,4 +33,12 @@ else echo "!! xmllint not installed, skipping (part of libxml2-utils)" >&2 fi +if command -v ec > /dev/null 2>&1; then + echo "==> editorconfig-checker" + # -disable-indent-size: see the "editorconfig" job in lint.yml for why. + ec -disable-indent-size || status=1 +else + echo "!! ec (editorconfig-checker) not installed, skipping (https://github.com/editorconfig-checker/editorconfig-checker)" >&2 +fi + exit "$status"