Skip to content

fix(standards): stop passing a stray empty argument when scope is unset - #167

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/fix-empty-scope-args-1558b730
Sep 11, 2026
Merged

twistedmelonman merged 1 commit into
mainfrom
claude/fix-empty-scope-args-1558b730

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

The bug

"${scope_args[@]-}" expands an empty array to one empty-string argument, not to nothing. run-standards.sh hits that empty string in its catch-all *) branch and exits 2:

skip list: ''
##[error]unknown argument:
##[error]Process completed with exit code 2.

So standards-check fails on any repo that requests no changed-since narrowing — that is, every repo running in whole-repo hygiene mode.

Why it matters now

standards-check / run-standards-check is the sole required check on dev-env, claude-config, dotfiles and github-workflows after today's protection change. While this is broken, those repos cannot merge anything.

Surfaced on nightowlstudiollc/reliquarist#93-96, which went from green to failing after a rebase onto current main. Not specific to those PRs, and not a Dependabot problem.

What is not the cause

--skip "" is fine. run-standards.sh parses --skip) skip="$2" and accepts an empty value without complaint — verified by running the real runner directly. The stray argument from the array expansion is the whole story.

The fix

Plain "${scope_args[@]}", which expands to nothing when empty and is safe under set -u on bash 4.4+ (runners are bash 5.x). Both forms are identical when the array is non-empty, so narrowing behaviour is unchanged.

The file already solved this exact problem for --changed-since at lines 235-240 — omit the flag rather than pass it empty. This applies the same discipline at the call site.

Verification

Ran the real runner with both expansion forms, counting unknown argument hits:

Expansion Hits
"${scope_args[@]-}" (old) 1
"${scope_args[@]}" (new) 0

The test

Asserts on argument assembly, not lint output, so it does not depend on linters being installed.

It carries a paired assertion that the known-bad form still reproduces. Without that, a future refactor could make the first assertion vacuous and the suite would stay green over a reintroduced bug. My first attempt at this test passed against the broken code — it is included in the form that actually fails against it.

17 passed, 0 failed. shellcheck -S info clean, no disable directives.

https://claude.ai/code/session_01ESsw699T54JHARkQXrdL3o

`"${scope_args[@]-}"` expands an EMPTY array to one empty-string argument
rather than to nothing. run-standards.sh then hits that empty string in its
catch-all `*)` branch, reports `unknown argument: ` and exits 2.

The effect is that standards-check fails on any repo that requests no
`changed-since` narrowing — which is every repo running the check in
whole-repo hygiene mode. The failure surfaced on nightowlstudiollc/reliquarist
#93-96 after a rebase, but it is not specific to those PRs or to Dependabot.

Plain `"${scope_args[@]}"` expands to nothing when the array is empty and is
safe under `set -u` on bash 4.4+; runners are bash 5.x. Both forms behave
identically when the array is non-empty, so narrowing is unaffected.

Note that `--skip ""` is NOT the cause: run-standards.sh accepts an empty
`--skip` value without complaint. Verified by running the real runner with
both expansion forms — the old form produces one `unknown argument` hit, the
new form produces zero.

The regression test asserts on argument assembly rather than lint output, so
it does not depend on linters being installed, and it carries a paired
assertion that the known-bad form still reproduces — without which the first
assertion could silently become vacuous.

Advances #116 context: standards-check is now the sole required check on four
repos, so this failure blocks all merges there until fixed.

Claude-Session: https://claude.ai/code/session_01ESsw699T54JHARkQXrdL3o
@twistedmelonman
twistedmelonman merged commit e6e2643 into main Sep 11, 2026
3 checks passed
@twistedmelonman
twistedmelonman deleted the claude/fix-empty-scope-args-1558b730 branch September 11, 2026 22:14
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.

1 participant