Skip to content

Commit 15d8932

Browse files
jamesadevineCopilot
andcommitted
fix(compile): silence shellcheck SC2046 on $(AW_AZ_MOUNTS) macro
The new `$(AW_AZ_MOUNTS)` line in the AWF invocation chain is an ADO macro substituted before bash sees it, not a bash command substitution. shellcheck cannot distinguish the two and flagged every compiled fixture with SC2046 ("Quote this to prevent word splitting"), turning Build & Test red. Word splitting of the expanded value into separate `--mount` tokens is intentional and required (the pipeline variable expands to `--mount /opt/az:/opt/az:ro --mount /usr/bin/az:/usr/bin/az:ro` or to the empty string). Quoting would produce a single malformed token. Disable SC2046 with an inline directive on the `sudo -E` line in all four base templates (base, 1es-base, job-base, stage-base) so the directive applies to the multi-line awf invocation as a unit. Regenerated tests/safe-outputs/azure-cli.lock.yml; verified bash_lint_tests passes locally with shellcheck 0.11.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f50a1a9 commit 15d8932

5 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/data/1es-base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ extends:
344344
# sed -u = unbuffered (line-by-line) so output appears immediately.
345345
# tee writes to both stdout (ADO pipeline log) and the artifact file.
346346
# pipefail (set above) ensures AWF's exit code propagates through the pipe.
347+
# shellcheck disable=SC2046 # $(AW_AZ_MOUNTS) is an ADO macro substituted before bash sees it, not bash command substitution; word-splitting the expanded value into separate --mount tokens is intentional
347348
sudo -E "$(Pipeline.Workspace)/awf/awf" \
348349
--allow-domains "{{ allowed_domains }}" \
349350
--skip-pull \

src/data/base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ jobs:
316316
# sed -u = unbuffered (line-by-line) so output appears immediately.
317317
# tee writes to both stdout (ADO pipeline log) and the artifact file.
318318
# pipefail (set above) ensures AWF's exit code propagates through the pipe.
319+
# shellcheck disable=SC2046 # $(AW_AZ_MOUNTS) is an ADO macro substituted before bash sees it, not bash command substitution; word-splitting the expanded value into separate --mount tokens is intentional
319320
sudo -E "$(Pipeline.Workspace)/awf/awf" \
320321
--allow-domains "{{ allowed_domains }}" \
321322
--skip-pull \

src/data/job-base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ jobs:
303303
# sed -u = unbuffered (line-by-line) so output appears immediately.
304304
# tee writes to both stdout (ADO pipeline log) and the artifact file.
305305
# pipefail (set above) ensures AWF's exit code propagates through the pipe.
306+
# shellcheck disable=SC2046 # $(AW_AZ_MOUNTS) is an ADO macro substituted before bash sees it, not bash command substitution; word-splitting the expanded value into separate --mount tokens is intentional
306307
sudo -E "$(Pipeline.Workspace)/awf/awf" \
307308
--allow-domains "{{ allowed_domains }}" \
308309
--skip-pull \

src/data/stage-base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ stages:
317317
# sed -u = unbuffered (line-by-line) so output appears immediately.
318318
# tee writes to both stdout (ADO pipeline log) and the artifact file.
319319
# pipefail (set above) ensures AWF's exit code propagates through the pipe.
320+
# shellcheck disable=SC2046 # $(AW_AZ_MOUNTS) is an ADO macro substituted before bash sees it, not bash command substitution; word-splitting the expanded value into separate --mount tokens is intentional
320321
sudo -E "$(Pipeline.Workspace)/awf/awf" \
321322
--allow-domains "{{ allowed_domains }}" \
322323
--skip-pull \

tests/safe-outputs/azure-cli.lock.yml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)