]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Chore: Configure pre-commit to format our s6-overlay files (#11414)
authorTrenton H <797416+stumpylog@users.noreply.github.com>
Wed, 19 Nov 2025 21:34:29 +0000 (13:34 -0800)
committerGitHub <noreply@github.com>
Wed, 19 Nov 2025 21:34:29 +0000 (21:34 +0000)
.editorconfig
.pre-commit-config.yaml
docker/rootfs/etc/s6-overlay/s6-rc.d/init-env-file/run
docker/rootfs/etc/s6-overlay/s6-rc.d/init-wait-for-db/run
docker/rootfs/etc/s6-overlay/s6-rc.d/svc-webserver/run

index 8111f01d860f9215f9a029eb8075430c327917ea..a8b21f510fb324c15700ea7fda1578cfa742a3e8 100644 (file)
@@ -11,6 +11,10 @@ end_of_line = lf
 charset = utf-8
 max_line_length = 79
 
+[*.sh]
+indent_style = tab
+indent_size = 1
+
 [{*.html,*.css,*.js}]
 max_line_length = off
 
index 7c0167d94eb97385109c7a1209ef8ecdd8666ab2..92e18bfbd0161ed3eb18e58d7afa0d8385726a23 100644 (file)
@@ -49,12 +49,12 @@ repos:
           - 'prettier-plugin-organize-imports@4.1.0'
   # Python hooks
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.14.0
+    rev: v0.14.5
     hooks:
       - id: ruff-check
       - id: ruff-format
   - repo: https://github.com/tox-dev/pyproject-fmt
-    rev: "v2.11.0"
+    rev: "v2.11.1"
     hooks:
       - id: pyproject-fmt
   # Dockerfile hooks
@@ -64,11 +64,11 @@ repos:
       - id: hadolint
   # Shell script hooks
   - repo: https://github.com/lovesegfault/beautysh
-    rev: v6.2.1
+    rev: v6.4.2
     hooks:
       - id: beautysh
-        additional_dependencies:
-          - setuptools
+        types: [file]
+        files: (\.sh$|/run$|/finish$)
         args:
           - "--tab"
   - repo: https://github.com/shellcheck-py/shellcheck-py
@@ -76,7 +76,7 @@ repos:
     hooks:
       - id: shellcheck
   - repo: https://github.com/google/yamlfmt
-    rev: v0.18.0
+    rev: v0.20.0
     hooks:
       - id: yamlfmt
         exclude: "^src-ui/pnpm-lock.yaml"
index d2c118ddbc20484d31a38b6e7b25e57b8366bcb3..2fc64e24ebe27dfdedf669dc8db4fd9e1bfe5674 100755 (executable)
@@ -29,5 +29,5 @@ if find /run/s6/container_environment/*"_FILE" -maxdepth 1 > /dev/null 2>&1; the
                fi
        done
 else
-               echo "${log_prefix} No *_FILE environment found"
+       echo "${log_prefix} No *_FILE environment found"
 fi
index 9278e787d547fe5edfab6063e6cf039b9f8c70ff..8ec900212edf4ff542076cfd540f9d68eafb773b 100755 (executable)
@@ -12,24 +12,24 @@ declare -i DELAY=0
 declare -i STARTED_AT=${EPOCHSECONDS:?EPOCHSECONDS var unset}
 
 delay_next_attempt() {
-    local -i elapsed=$(( EPOCHSECONDS - STARTED_AT ))
-    local -ri remaining=$(( TIMEOUT - elapsed ))
+       local -i elapsed=$(( EPOCHSECONDS - STARTED_AT ))
+       local -ri remaining=$(( TIMEOUT - elapsed ))
 
-    if (( remaining <= 0 )); then
-        echo "${LOG_PREFIX} Unable to connect after $elapsed seconds."
-        exit 1
-    fi
+       if (( remaining <= 0 )); then
+               echo "${LOG_PREFIX} Unable to connect after $elapsed seconds."
+               exit 1
+       fi
 
-    DELAY+=1
+       DELAY+=1
 
-    # clamp to remaining time
-    if (( DELAY > remaining )); then
-        DELAY=$remaining
-    fi
+       # clamp to remaining time
+       if (( DELAY > remaining )); then
+               DELAY=$remaining
+       fi
 
-    ATTEMPT+=1
-    echo "${LOG_PREFIX} Attempt $ATTEMPT failed! Trying again in $DELAY seconds..."
-    sleep "$DELAY"
+       ATTEMPT+=1
+       echo "${LOG_PREFIX} Attempt $ATTEMPT failed! Trying again in $DELAY seconds..."
+       sleep "$DELAY"
 }
 
 wait_for_postgres() {
@@ -40,7 +40,7 @@ wait_for_postgres() {
        local -r user="${PAPERLESS_DBUSER:-paperless}"
 
        while ! pg_isready -h "${host}" -p "${port}" --username "${user}"; do
-        delay_next_attempt
+               delay_next_attempt
        done
        echo "${LOG_PREFIX} Connected to PostgreSQL"
 }
@@ -52,7 +52,7 @@ wait_for_mariadb() {
        local -r port="${PAPERLESS_DBPORT:-3306}"
 
        while ! mariadb-admin --host="$host" --port="$port" ping --silent >/dev/null 2>&1; do
-        delay_next_attempt
+               delay_next_attempt
        done
        echo "${LOG_PREFIX} Connected to MariaDB"
 }
index 841dad204e138e3a69495316033463c97d9c2d66..64b458150ae29d612da6b9dfc32aa7b2c34fd6fe 100755 (executable)
@@ -10,11 +10,11 @@ export GRANIAN_WORKERS=${GRANIAN_WORKERS:-${PAPERLESS_WEBSERVER_WORKERS:-1}}
 
 # Only set GRANIAN_URL_PATH_PREFIX if PAPERLESS_FORCE_SCRIPT_NAME is set
 if [[ -n "${PAPERLESS_FORCE_SCRIPT_NAME}" ]]; then
-  export GRANIAN_URL_PATH_PREFIX=${PAPERLESS_FORCE_SCRIPT_NAME}
+       export GRANIAN_URL_PATH_PREFIX=${PAPERLESS_FORCE_SCRIPT_NAME}
 fi
 
 if [[ -n "${USER_IS_NON_ROOT}" ]]; then
-  exec granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
+       exec granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
 else
-  exec s6-setuidgid paperless granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
+       exec s6-setuidgid paperless granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
 fi