lint: split ENV_PAIRS into an array in the hook harness #765

Open
opened 2026-10-14 19:14:35 +00:00 by hexajon · 0 comments
Owner

What

hooks/tests/lib-hook-harness.sh:616 and :621 disable SC2086 inline. gate_exec runs env $env_pairs bash "$gate", and the unquoted $env_pairs is word-split on purpose into NAME=VALUE arguments.

How

Inside gate_exec, split the string into an array once with read -ra, then run env "${pairs[@]}" bash "$gate". The callers keep passing one string.

Acceptance

  • No SC2086 disable remains in the harness.
  • Every hook test passes.
## What `hooks/tests/lib-hook-harness.sh:616` and `:621` disable SC2086 inline. `gate_exec` runs `env $env_pairs bash "$gate"`, and the unquoted `$env_pairs` is word-split on purpose into `NAME=VALUE` arguments. ## How Inside `gate_exec`, split the string into an array once with `read -ra`, then run `env "${pairs[@]}" bash "$gate"`. The callers keep passing one string. ## Acceptance - No SC2086 disable remains in the harness. - Every hook test passes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
sixfold-space/madtea#765
No description provided.