From a3fb856ce67c4b8e894eec4a3e4aac90f162ad91 Mon Sep 17 00:00:00 2001 From: dann frazier Date: Tue, 15 Sep 2026 12:18:44 -0600 Subject: [PATCH] fix(shellcheck-run-steps): pass all pipeline dirs via --pipeline-dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 399c363 passed each pipeline directory with its own --pipeline-dir flag. `melange compile` treats that flag as a single string, so repeated flags collapse to the last one. For enterprise packages, that leaves only ./pipelines/os. A package that uses a pipeline from ./pipelines/ still fails with "unable to load pipeline", which is the error commit 399c363 set out to fix. chainguard-dev/melange#2656 adds --pipeline-dirs to `melange compile`. This flag takes a comma-separated list, the same format `melange build` already uses. Pass the directories through --pipeline-dirs instead. The fallback for unknown directories uses the same flag, so one code path covers both cases. This fix needs the melange:latest image to include that change. An older image rejects --pipeline-dirs as an unknown flag, and the hook then fails for every package. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Fable 5.1 Signed-off-by: dann frazier --- pre_commit_hooks/shellcheck_run_steps.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pre_commit_hooks/shellcheck_run_steps.py b/pre_commit_hooks/shellcheck_run_steps.py index 32d4842..dece31c 100644 --- a/pre_commit_hooks/shellcheck_run_steps.py +++ b/pre_commit_hooks/shellcheck_run_steps.py @@ -33,12 +33,16 @@ def _pipeline_dirs_for(filename: str) -> list[str]: - """Return the --pipeline-dir flags appropriate for *filename*.""" + """Return the --pipeline-dirs flag appropriate for *filename*. + + `melange compile` reads only the last of repeated --pipeline-dir flags, + so the directories go in a single comma-separated --pipeline-dirs. + """ for prefix, dirs in PIPELINE_DIRS.items(): if filename.startswith(prefix): - return [f"--pipeline-dir={d}" for d in dirs] + return [f"--pipeline-dirs={','.join(dirs)}"] # Fallback: derive from the file's own directory (original behaviour). - return [f"--pipeline-dir=./{os.path.dirname(filename)}/pipelines"] + return [f"--pipeline-dirs=./{os.path.dirname(filename)}/pipelines"] # Returns False if shellcheck reports issues