Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pre_commit_hooks/shellcheck_run_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading