Skip to content

Pre-commit: fix the shellcheck and hadolint findings and run every hook in CI (closes #368) - #374

Merged
tae898 merged 1 commit into
mainfrom
chore/368-365-hygiene
Nov 12, 2026
Merged

tae898 merged 1 commit into
mainfrom
chore/368-365-hygiene

Conversation

@tae898

@tae898 tae898 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #368. Refs #365 (its code and config items; the docs items are in a second pull request).

The Pre-commit workflow skipped shellcheck and hadolint-docker, so those two hooks protected nothing. I fixed the findings and removed the SKIP line with its comment, so every hook runs in CI.

What changed:

  • scripts/build.sh, scripts/build-native.sh, scripts/run_examples.sh, native/scripts/build-image.sh: ls parsing became find or a glob loop, word-split argument strings became arrays, the source list of the Java bridge goes through find -print0 | xargs -0, expansions are quoted. The SC2153 on EXAMPLES in run_examples.sh is a false positive (an input of the workflows), disabled on that one line with the reason.
  • scripts/Dockerfile.build: every stage with a pipe sets SHELL ["/bin/bash", "-o", "pipefail", "-c"] (DL4006). The jdeps, grep and paste steps keep their old tolerance with || true, as build-native.sh has it. jlink takes --module-path through the positional parameters, the smoke test script is written with printf (bash echo does not expand \n, dash did), and apt-get uses --no-install-recommends. DL3008 (pinned apt versions) is ignored per instruction, with the reason next to it: the base images are rolling tags, and a pinned version disappears at the next point release.
  • .shellcheckrc: follow source lines.
  • From Docs drift found by the weekly audit of 2026-11-11: the text fixes are in a PR, re-runs and code changes are listed here #365: the local no-old-package-name hook uses language: python instead of the system python3; the pyproject.toml comment names the README section that exists; the version examples in build.sh and build_wheel.py name 26.12.1 and 26.11.1.

What I ran: uvx pre-commit run --all-files with no SKIP, all hooks green. I ran run_examples.sh old and new against a stub interpreter in a fake examples/ tree: the calls, outputs and GitHub outputs are identical, apart from one difference in my favour (a glob without a match no longer aborts the run). The smoke test script that printf writes has the same bytes as the dash echo wrote, minus one trailing newline. I also unit-tested the new find, -nt and array constructs against the old ones.

What I could not run here: the Docker build and the native image scripts. They run in the existing CI jobs (the test-jvm.yml builds and the native build), and those must be green before this merges.

🤖 Generated with Claude Code

…ok in CI (closes #368, refs #365)

The Pre-commit workflow skipped shellcheck and hadolint-docker because the repository had findings for both, so neither protected anything. This fixes the findings and removes the SKIP.

Shell scripts (build.sh, build-native.sh, run_examples.sh, native/scripts/build-image.sh): ls parsing becomes find or a glob loop (newest_wheel() compares mtimes with -nt), word-split argument strings become arrays (DOCKER_BUILD_ARGS, read -r -a for the example arguments and the EXAMPLES globs), the javac source list goes through find -print0 | xargs -0, expansions are quoted. run_examples.sh run against a stub interpreter gives the same calls, outputs and GitHub outputs as before.

Dockerfile.build: each stage that runs pipes sets SHELL bash -o pipefail (DL4006); the jdeps, grep and paste steps keep their old tolerance with || true, as build-native.sh has it; jlink gets its --module-path through the positional parameters; the smoke test script is written with printf (bash echo does not expand \n, dash echo did; the bytes are identical); --no-install-recommends (DL3015). DL3008 (pinned apt versions) is ignored per instruction with the reason: the base images are rolling tags.

.shellcheckrc follows the source lines (external-sources, SCRIPTDIR).

#365 code and config items: the local hook runs with language python instead of the system python3, the pyproject.toml comment names a README section that exists, and the version examples of build.sh and build_wheel.py name 26.12.1 and 26.11.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tae898
tae898 force-pushed the chore/368-365-hygiene branch from 585cf54 to eebdcee Compare November 12, 2026 01:52
@tae898
tae898 merged commit 11ec068 into main Nov 12, 2026
50 of 52 checks passed
@tae898
tae898 deleted the chore/368-365-hygiene branch November 12, 2026 03:11
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-commit: fix the shellcheck and hadolint findings and remove the SKIP

1 participant